angularjs select 赋值 ng-options配置方式
angularjs select 赋值 ng-options配置方式数组方式数据是数组$scope.years = [2014, 2015, 2016];页面元素 <select ng-model="item" ng-options="item as y for y in years">
</select>设置默认值
如果需要设置默认的选项,可以先设置一个参数:$scope.item = 2
原创
2016-12-24 17:38:49 ·
20425 阅读 ·
2 评论