【发布时间】:2012-11-07 21:16:22
【问题描述】:
我有一组项目,我想在 ng-repeat 中过滤,使用 ng-model 作为字符串来过滤集合,到目前为止,我还没有找到一种方法让它在表达式被否定时工作,我正在做这样的事情:
<select ng-model="languageOrigin" ng-change="updatePrice()">
<option ng-repeat="language in languages">{{language}}</option>
</select>
<select ng-model="languageDestination" ng-change="updatePrice()">
<option ng-repeat="language in languages | filter:!languageOrigin">{{language}}</option>
</select>
在documentation 中,它说我们应该使用 !否定表达式,但仍然没有运气。
我做错了什么?
【问题讨论】:
-
如果您的过滤器是一种方法(不是字符串或模型)解决方案发布在这里:stackoverflow.com/questions/13464809/…
标签: angularjs