Angular2 ngFor 跳过第一个索引[重复]

2024-02-19

如何跳过数组中的第一个索引?

<li *ngFor="#user of users">
    {{ user.name }} is {{ user.age }} years old.
  </li>

你可以使用片管 https://angular.io/docs/ts/latest/api/common/index/SlicePipe-pipe.html.

<li *ngFor="#user of users | slice:1">
  {{ user.name }} is {{ user.age }} years old.
</li>

第一个参数对应于表示起始索引的正整数。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Angular2 ngFor 跳过第一个索引[重复] 的相关文章