考虑以下对象:
var orderedFlights = {
"Airline 1": {},
"Airline 2": {},
"Airline 3": {}
}
使用ng-options是否可以在对象的键上track by
?
<select
class="form-control"
ng-change="flightNumber = airline[0]"
name="airline"
id="airline"
ng-model="airline"
ng-options="airline for (airline, flights) in orderedFlights track by airline">
</select>
答案 0 :(得分:0)
试试这个
ng-options="airline as airline for (airline, flights) in orderedFlights track by airline">