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];
});
原文地址:https://www.cnblogs.com/xyc211/p/7420115.html