omer cohen omer cohen - 14 days ago 7
AngularJS Question

Add image in options using angular

I came across a lot of answers but none of them seems to be working.

I tried :

option 1:

<select class="form-control" name="country" ng-model="user.country">
<option value="">choose country</option>
<option ng-repeat="item in countries" value="{{item.name}}" ng-style="background:url('../images/flage/+item.name+.png')>{{item.name}}</option>
</select>


option 2:

<select class="form-control" name="country" ng-model="user.country">
<option value="">choose country</option>
<option ng-repeat="item in countries" value="{{item.name}}" ng-style="background:url('../images/flage/+{{item.name}}+.png')>{{item.name}}</option>
</select>


option 3 :

<select class="form-control" name="country" ng-model="user.country">
<option value="">choose country</option>
<option ng-repeat="item in countries" value="{{item.name}}" data-image="('../images/flage/item.name.png')">{{item.name}}</option>
</select>


option 4 :

<select class="form-control" name="country" ng-model="user.country">
<option value="">choose country</option>
<option ng-repeat="item in countries" value="{{item.name}}" data-image="('../images/flage/{{item.name}}.png')">{{item.name}}</option>
</select>


None of them seems to work.

Answer

after all answers , sorry no one give me, i did that MY SELECT UI.

anyone can use it and change it and style it how he wanted.

thank you.