I want to use ng-repeat in Angular, while I only want to output some elements of the array. An Example:
ng-repeat=\"item in items | filter:($index%3 == 0)\"
An alternate approach to solving this creates a new "list" (I don't know the proper term in this context) in the ng-repeat. This new list can then be referred to within the scope
-
[{{$index + 1}}] {{filteredFriends[$index].name}} who is {{filteredFriends[$index].age}} years old.
[{{$index + 2}}] {{filteredFriends[$index+1].name}} who is {{filteredFriends[$index+1].age}} years old.
The ng-if on the span wrapping the second half prevents the base text from being shown when the previous element is the last element of the list.