如何设置ng-options默认值...
这是我的ng-option指令:
ng-options="val as val for val in ticket_group.splits"
答案 0 :(得分:0)
使用ng-init
<select ng-init="myModel = ticket_group.splits[0]" ng-model="myModel" ng-options="val as val for val in ticket_group.splits"></select>
或在控制器中设置myModel
值,
$scope.myModel = ticket_group.splits[0]; // ticket_group.splits[1]; ticket_group.splits[2]; .. or what u need