AngularJS Select綁定的是物件:
$scope.cars = {
car01 : {brand : "Ford", model : "Mustang", color : "red"},
car02 : {brand : "Fiat", model : "500", color : "white"},
car03 : {brand : "Volvo", model : "XC90", color : "black"}
};
<select ng-model="selectedCar" ng-options="y.brand for (x, y) in cars"></select>
現在想給select一個預設值怎麼設定呢?
這樣就是預設選取第一項
--請選擇--選項>