我正在使用 ng-repeat + Filter + Pagination(ui-bootstrap)
1- ng-repeat + 过滤器工作正常:
<tr data-ng-repeat="target in targets | filter:search track by $index">
2- ng-repeat + filter + pagination 也可以正常工作:
<tr data-ng-repeat="target in targets | filter:search | startFrom:(currentPage - 1) * pageSize | limitTo: pageSize ">
3-问题是当我结合 ng-repeat + Filter + Pagination + track by $index
<tr data-ng-repeat="target in targets | filter:search | startFrom:(currentPage - 1) * pageSize | limitTo: pageSize track by $index">
我的索引值在每页中从 0 重新开始到 4
关于“track by $index”正确顺序的任何想法!我应该把它放在哪里?