问题
How can I skip the first index from the array?
<li *ngFor="#user of users">
{{ user.name }} is {{ user.age }} years old.
</li>
回答1:
You could use the slice pipe.
<li *ngFor="#user of users | slice:1">
{{ user.name }} is {{ user.age }} years old.
</li>
The first parameter corresponds to a positive integer representing the start index.
回答2:
There is the SlicePipe for this use case:
<li *ngFor="let user of users | slice:1">
{{ user.name }} is {{ user.age }} years old.
</li>
来源:https://stackoverflow.com/questions/35405374/angular2-ngfor-skip-first-index