<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>
I want to get element count of the Items and want to show "Next >" for last item
Something like this
<li ng-repeat="Item in Items">
<a ng-if="$first" href="#">< Previous</a>
<a ng-if="!$first && !$last" href="#">{{$index}}</a>
<a ng-if="$last" href="#">Next ></a>
</li>
To get the length use Items.length
. It becomes more complex if there is a filter. See this SO post
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With