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)\"
Create a custom filter, for example:
filter('modulo', function(){ return function (arr, div, val) { return arr.filter(function(item, index){ return index % div === (val || 0); }) }; });
Then change the ng-repeat to:
ng-repeat
Or filter by (index % 3 === 1) like:
(index % 3 === 1)
http://jsfiddle.net/Tc34P/2/