相同的过滤器给我不同的结果

时间:2015-07-03 11:06:37

标签: angularjs filter ng-repeat

我的“过滤器”ng-if在我的代码中运行得非常好:

 <li ng-if="item.qext.type == 'mashup'" data-id="{{item.id}}" ng-repeat="item in assets.extensionList">

但是我想用它来扭转它:

<li data-id="{{item.id}}" ng-repeat="item in assets.extensionList | filter: (item.qext.type == 'mashup')">

为了最终做类似的事情:

 <li data-id="{{item.id}}" ng-repeat="item in filteredMashups = assets.extensionList | filter: (item.qext.type == 'mashup')">

但由于某种原因,这个过滤器:

ng-repeat="item in assets.extensionList | filter: (item.qext.type == 'mashup')"

没有给出与此相同的结果:

ng-if="item.qext.type == 'mashup'"

为什么?

0 个答案:

没有答案