need to hide 1st value in drop-down box and display rest of the values using angular .drop-down values will come from backend response
Ex : drop-down contains below values .here I need to hide mango and display rest values
Mango
Apple
Orange
need to hide 1st value in drop-down box and display rest of the values using angular .drop-down values will come from backend response
Ex : drop-down contains below values .here I need to hide mango and display rest values
Mango
Apple
Orange
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Deepak RawatPosted Jun 29, 2023, 6:03 PM
In your component code, retrieve the dropdown values from the backend response and assign them to a variable. Let's assume you have the following array of values:
Create a new variable to store the filtered dropdown values, excluding the first value:
In your template, bind the
filteredDropdownValuesvariable to the dropdown element usingngFor:the first value, "Mango," is excluded from the
filteredDropdownValuesarray, and the remaining values are displayed in the dropdown box.