我有一个带有[1、2、3]的$ scope.forumList,我想使用从2开始的ng-option我该怎么办?
<select name="forum"
ng-change="filterBlob()"
ng-model='f'
ng-options='f as f.name for f in forumList'
required>
</select>
我不确定您如何使用它,ng-options
但是使用option
,可以如ng-if
本演示中所示使用来完成它。
请在下面找到代码:
HTML:
<div ng-app="app" ng-controller="test">
<select ng-model="selected">
<option value="">Select</option>
<option ng-repeat="item in data" ng-value="item" ng-if="$index > 0">{{item}}
</option>
</div>
JS:
var app = angular. module('app',[]);
app.controller ('test', function ($scope){
$scope.data = [1,2,3,4];
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句