angularjs - Insert HTML Tags in ng-options -
i'm trying insert html tags in ng-options
, when document's rendered options have icons before text.
html:
<select chosen id="receive-country-selection" ng-model="current.recipientcountry" ng-change="selectrecipientcountry(current.recipientcountry)" ng-options="x.name.tolowercase() x in data.recipientcountries" > <option value=""></option> </select>
needs rendered like:
<select chosen id="receive-country-selection" ng-model="current.recipientcountry" ng-change="selectrecipientcountry(current.recipientcountry)" ng-options="x.name.tolowercase() x in data.recipientcountries" > <option> <span class="flag-sprite-container"> <svg class="flag-sprite"> <use xlink:href="someurl"></use> </svg> </span> text </option> </select>
i'd know if there's non-jquery option this.
additional info: i'm using jquery chosen copies select
ul
, option
li
.
the option tag supports text. can find other implementations using div sections behaves drop down. know twitter has library called typeahead has sort of behavior. there many other such libraries.
Comments
Post a Comment