角度ng重复元素计数 [英] Angular ng-repeat element count

查看:165
本文介绍了角度ng重复元素计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<li ng-repeat="Item in Items">
            <div ng-switch="($index)==0">
                <div ng-switch-when="true">
                    <a href="#"><   Previous</a>
                </div>
                <div ng-switch-when="false">
                    <a href="#">{{$index}}</a>
                </div>
            </div>
        </li>





我想得到Items的元素数,并希望显示Next>最后一项



I want to get element count of the Items and want to show "Next >" for last item

推荐答案

index)== 0 >
< div ng-switch-when = true >
< a href = > < 上一页< / a >
< / div >
< div ng- switch-when = false > ;
< a href = > {{
index)==0"> <div ng-switch-when="true"> <a href="#">< Previous</a> </div> <div ng-switch-when="false"> <a href="#">{{


index}} < < span class =code-leadattribute> / a >
< / div >
< / div >
< / li >
index}}</a> </div> </div> </li>





我想得到项目的元素数,并希望为最后一项显示Next>



I want to get element count of the Items and want to show "Next >" for last item


这篇关于角度ng重复元素计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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