我有一个选择的性别列表.
码:
<select>
<option>male</option>
<option>female</option>
<option>others</option>
</select>
Run Code Online (Sandbox Code Playgroud)
我想在下拉列表中使用drop-down-icon.jpeg中的图像.
我想添加一个按钮代替下拉图标.
怎么做?
情况:
我需要在语言选择中插入标志.我在谷歌和StackOverflow上搜索过但是创建的解决方案对我不起作用.
代码:
在控制器中:
$scope.language_list = [{'name': 'english', 'url': 'https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/gb.png'},{'name': 'italian', 'url': 'https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/it.png'}];
Run Code Online (Sandbox Code Playgroud)
在视图中:
<select ng-model="language_selected">
<option ng-repeat="language in language_list" data-image="{{language.url}}" >{{language.name}}</option>
</select>
Run Code Online (Sandbox Code Playgroud)
例:
http://jsfiddle.net/tcVhN/168/
问题:
如何在角度选择内插入图像?
编辑:
这是解决方案的Plunker,清理了: