【发布时间】:2014-08-28 19:49:33
【问题描述】:
我有一个自定义函数用作过滤器。如何获取过滤后的当前元素的索引。
<tr ng-repeat="(idx, line) in items | filter:inRange">....</tr>
//this is the filter
$scope.inRange = function(item) {
//how to get the index here?
};
请注意,我不想使用 indexOf
var idx = $scope.items.indexOf(item);
【问题讨论】:
-
I do not want to use indexOf不清楚你在期待什么
标签: angularjs angularjs-ng-repeat