Malcr001
Malcr001

Reputation: 8289

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

Upvotes: 5

Views: 4405

Answers (1)

Aleksander Blomskøld
Aleksander Blomskøld

Reputation: 18552

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>

Upvotes: 7

Related Questions