How to select drop down values in angular 4

岁酱吖の 提交于 2019-12-14 03:19:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!