跳过NG-重复第一项 [英] Skip first item in ng-repeat

查看:140
本文介绍了跳过NG-重复第一项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想跳过NG-重复的第一个项目

  ..先到这里项< UL类=高亮-topright>
        <李NG重复=项hpHeadlines |过滤器:$指数大于0>
          ...
        < /李>
< / UL>

这是行不通的,这里有什么问题?

据我所知,我可以使用NG-如果NG-显示隐藏的东西,但我不能明白为什么过滤器不1.3.x中在这种情况下工作。

感谢。


解决方案

 < UL类=突出-topright>
        <>李纳克重复= NG-IF =0 $索引&gt,在hpHeadlines项目;
          ...
        < /李>
< / UL>

I want to skip the first item in ng-repeat

..first item here  

<ul class="highlight-topright">
        <li ng-repeat="item in hpHeadlines | filter:$index>0">
          ...
        </li>
</ul>

it doesn't work, anything wrong here ?

I understand that i can use ng-if, ng-show to hide things but I just cannot get why the filter doesn't work in 1.3.x in this case.

Thanks.

解决方案

<ul class="highlight-topright">
        <li ng-repeat="item in hpHeadlines" ng-if="$index > 0">
          ...
        </li>
</ul>

这篇关于跳过NG-重复第一项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆