我的“过滤器”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'"
为什么?