0
<select ng-options="item.subItem as item.label for item in items track by item.id" ng-model="selected"></select>
一切運行良好,但現在從服務器答案來自於item.label
一個不確定的值。有時。
如果此字段不存在,是否可以在此行中添加條件,然後應用另一條?或者這是不可能的ng-options
?像這樣:
<select ng-options="item.subItem as item.label || item.id for item in items track by item.id" ng-model="selected"></select>