5

我有一个 ng-repeated 列表,仅当 $index 大于 1 时,如何在列表中显示按钮?

plunkr 开始使用:Plunkr

4

1 回答 1

7

ng-if仅在 Angular 1.1.5 及更高版本中可用。要么升级 Angular 版本,要么使用ng-show代替:

<p data-ng-show="$index > 1">
  <a href="#">This button will only show when index is more than 1</a>
</p>
于 2013-06-05T11:35:49.833 回答