Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS: ng-repeat from second index

I would like to ng-repeat but only from the second array element until the last. I tried to use

ng-repeat="entry in entries | filter: $index==0"

but this one didn't work. If I attempt to use ng-if, like this

ng-repeat="entry in entries" ng-if="$index != 0"

I am getting error in transclusion.

What's the best solution for this? BTW, my AngularJS version is 1.1.5 because my app is a plugin for Hawtio (which is still stuck in version 1.1.5). Thanks.

like image 419
oikonomiyaki Avatar asked Oct 29 '14 06:10

oikonomiyaki


1 Answers

Why not just:

ng-repeat="entry in entries.slice(1,entries.length)"

Fiddle: http://jsfiddle.net/10d6o1aq/

like image 72
Ivan Chernykh Avatar answered Oct 25 '22 15:10

Ivan Chernykh