Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
18
rated 0 times [  19] [ 1]  / answers: 1 / hits: 27535  / 11 Years ago, fri, december 20, 2013, 12:00:00

I am trying to auto filter an ng-repeat list by even index. Is it possible to do this somehow? Here's what I am trying but it isn't working:



<div data-ng-repeat=thing in things | filter:$even >
<div>{{thing.name}}</div>
</div>


Is there a proper way of achieving this?


More From » angularjs

 Answers
12

This will show $even names of the things list.



<div ng-repeat=thing in things ng-if=$even>
{{thing.name}}
</div>

[#73645] Wednesday, December 18, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
devinjadong

Total Points: 711
Total Questions: 117
Total Answers: 100

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
devinjadong questions
Thu, Feb 17, 22, 00:00, 2 Years ago
Wed, Dec 8, 21, 00:00, 2 Years ago
Tue, Oct 27, 20, 00:00, 4 Years ago
Fri, Oct 18, 19, 00:00, 5 Years ago
;