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)\"
All the precedent answers will work, but if you want to use a filter, you can also define it yourself, like in this fiddle : http://jsfiddle.net/DotDotDot/58y7u/
.filter('myFilter', function(){
return function(data, parameter){
var filtered=[];
for(var i=0;i
and then call it like this :
ng-repeat='item in items | myFilter:3'
(I added extra complexity with a parameter, if you want to change it quickly to even numbers for example)
Have fun
++