Looping using ngFor and skip nth element

Philip John picture Philip John · Feb 21, 2017 · Viewed 15.6k times · Source

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

Answer

Günter Zöchbauer picture Günter Zöchbauer · Feb 21, 2017
<div *ngFor="let item of items; let i=index">
  <div *ngIf="i != n">{{i}} is not n</div>
</div>