I was wondering if there is a way in angular2 to loop through an array or a list using *ngFor
and skip the first or nth element
I just learned from another issue, you can do it with Slice pipe
*ngFor="let item of items | slice:1;
where 1 is your nth element
https://angular.io/api/common/SlicePipe
see also: Angular start ngFor index from 1
<div *ngFor="let item of items; let i=index">
<div *ngIf="i != n">{{i}} is not n</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With