Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

show button in repeated list only if index is more than 1

I have an ng-repeated list how do I show a button within the list only if $index is more than 1 ?

plunkr to get started: Plunkr

like image 990
Malcr001 Avatar asked Jun 05 '13 11:06

Malcr001


1 Answers

ng-if is only in available in angular 1.1.5 and later. Either upgrade the Angular version, or use ng-show instead:

<p data-ng-show="$index > 1">
  <a href="#">This button will only show when index is more than 1</a>
</p>
like image 123
Aleksander Blomskøld Avatar answered Nov 25 '22 07:11

Aleksander Blomskøld