我正在创建一个网络应用,其中我有一个下拉列表,看起来像这样
<select id="passengerCountDropDown" ng-change="reselectpassengerCount()" ng-options="passanger.Name for passanger in passangers" ng-model="passengerCountArray"></select>
这就是我填写数据的方式
scope.passangers = [{ Name: "Passanger 1", Value: 1 }];
var totalPassangers = 21;
for (var i = 2; i <= totalPassangers; i++) {
scope.passangers.push({ "Name": "Passanger" + " " + i, "Value": i });
}
scope.passengerCountArray = scope.passangers[0];
scope.passengerCount = scope.passangers[0].Value;
现在问题是,我想在下拉列表中的选项上添加glyphicon,但我无法做到这一点,
我也尝试了另一个例子Here
但没有成功
<select ng-model="passengerCountArray">
<option ng-repeat="c in passangers" value="{{ $index }}">
<span class="glyphicon glyphicon-envelope"></span>
{{ c.Name }}
</option>
</select>
这是我的JSfiddle Click here
我怎样才能实现这一目标?
答案 0 :(得分:0)