技术员联盟提供win764位系统下载,win10,win7,xp,装机纯净版,64位旗舰版,绿色软件,免费软件下载基地!

当前位置:主页 > 教程 > 服务器类 >

angular select 默认值如何设置

来源:技术员联盟┆发布时间:2019-10-25 12:00┆点击:

<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;//如果想要第一个值