如下所示:
<select ng-model="selected" ng-options="x.id as x.name for x in users"></select>
$scope.users = [ {name:'a',id:'1'}, {name:'b',id:'2'}, {name:'c',id:'3'} ]; $scope.selected='2';//id的值,区分类型 $scope.selected=$scope.users[0].id;//如果想要第一个值
本文章地址http://www.vzeo.com/news/xuetang/800380.html 由 友站网 编辑整理,转载请注明出处