angular ngFor call function on last iteration code example Example: ngfor <li *ngFor="let item of items; index as i; trackBy: trackByFn">...</li>