加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

AngularJS:来自第二个索引的ng-repeat

发布时间:2020-12-17 07:19:35 所属栏目:安全 来源:网络整理
导读:我想ng-repeat,但只能从第二个数组元素到最后一个.我试着用 ng-repeat="entry in entries | filter: $index==0" 但是这个没用.如果我尝试使用ng-if,就像这样 ng-repeat="entry in entries" ng-if="$index != 0" 我在翻译中遇到错误. 什么是最好的解决方案?
我想ng-repeat,但只能从第二个数组元素到最后一个.我试着用
ng-repeat="entry in entries | filter: $index==0"

但是这个没用.如果我尝试使用ng-if,就像这样

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

我在翻译中遇到错误.

什么是最好的解决方案?顺便说一句,我的AngularJS版本是1.1.5,因为我的应用程序是Hawtio的插件(它仍然停留在1.1.5版本中).谢谢.

为什么不呢:
ng-repeat="entry in entries.slice(1,entries.length)"

小提琴:http://jsfiddle.net/10d6o1aq/

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读