问题
I have a select drop down where in i need to populate the selected value from API and the other options are hardcoded. On select of an option , I need to populate it along with the icon. After selection , the color of the option selected should be in blue color ( both text and icon ) with a tick mark besides it. How can i achieve this.
Above image shows the pre population of data ( both text and icon )from API.
Above image shows on click of a drop down, a tick mark is shown with change in text and icon color. Below is the code I have tried.
<select>
<option value="">{{ selectedTransResult.category }}</option>
<option value="1">Home</option>
<option value="2">Transport</option></select>
来源:https://stackoverflow.com/questions/53224532/how-to-select-drop-down-values-in-angular-4