AngularJS:第二个索引中的ng-repeat [英] AngularJS: ng-repeat from second index
本文介绍了AngularJS:第二个索引中的ng-repeat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想ng-repeat,但仅从第二个数组元素到最后一个.我尝试使用
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"
但是这个没有用.如果我尝试使用ng-if
,就像这样
but this one didn't work. If I attempt to use ng-if
, like this
ng-repeat="entry in entries" ng-if="$index != 0"
我在包容方面出错.
什么是最好的解决方案?顺便说一句,我的AngularJS版本是1.1.5,因为我的应用程序是Hawtio的插件(仍然停留在1.1.5版本中).谢谢.
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.
推荐答案
为什么不只是:
ng-repeat="entry in entries.slice(1,entries.length)"
提琴: http://jsfiddle.net/10d6o1aq/
这篇关于AngularJS:第二个索引中的ng-repeat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文