Filtering an Angular 1.2 ng-repeat with “track by” by a boolean property

核能气质少年 提交于 2019-11-27 07:21:24

The track by needs to be at the end of the expression:

<li ng-repeat="person in attendees | filter: {arrived: false } track by person.id">
Mistalis

@Gruff's answer is right, but just to give an answer from an official source:

From the Angular ng-repeat docs:

Note: track by must always be the last expression:

<div ng-repeat="model in collection | orderBy: 'id' as filtered_result track by model.id">
  {{model.name}}
</div>

It also appear on the "Arguments" part of the docs:

Note that the tracking expression must come last, after any filters, and the alias expression.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!