我有以下Angular JS代码:
<select ng-model="formData.beginDay[$index]" class=form-control" ng-required="!formData.current[$index]">
<option ng-repeat="day in data.dateList.day" value="{{day.id}}" ng-selected="day.id == '0'">
{{day.value}}
</option>
</select>
对象data.dateList
看起来像:
0: {id: 0, value: "G"}
id: 0
value: "G"
我设置了属性ng-selected
:
ng-selected="day.id == '0'"
但它没有选择选择列表中的第一个元素。