我有select
ng-repeat option
,如何显示options
除options
之外的所有'TM'
?
<select ng-model="mainCtrl.header.selectedItemId" class="form-control">
<option ng-repeat="option in mainCtrl.items | filter:'TM'" ng-value="option.id">{{option.name}}</option>
</select>
答案 0 :(得分:2)
如SO答案here中所述,您可以在filter
<select ng-model="mainCtrl.header.selectedItemId" class="form-control">
<option ng-repeat="option in mainCtrl.items | filter:'!TM'" ng-value="option.id">{{option.name}}</option>
</select>