angularjs的ng-options时如何设置默认值(初始值)
hhtml:
<select ng-change="change2()" ng-model="selected"
ng-options="item.id for item in datas">
</select>
angualrJs:
$http.get('url').then(function (res) {
$scope.datas= res.data;
$scope.selected= $scope.datas[0];
});

浙公网安备 33010602011771号