AngularJS Select默认值? 财富值86

2016-10-24 13:41发布

956 1 4

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一个默认值怎么设置呢?

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
1条回答

<option>--please select--</option>

63人赞 举报

一周热门 更多>