ng-options 對應 ng-model 為物件時正確顯示預設值
使用 track by 指定物件對應屬性找出預設選項
ng-model="food.vendor" ng-options='a.text for a in food.vendors track by a.value'
=>food.vendor.value=a.value
ng-model="food.vendor" ng-options='a.text for a in food.vendors track by a.value'
=>food.vendor.value=a.value
留言