[solved] Ionic 2 - Callback when ngFor finishes

Still looking to call a method when ngFor finish?

I use following method, if I reckon correctly it was a solution proposed by @mhartington

<div *ngFor="let something of stuffs; let i=index; let last = last;"> 
      {{executeSomethingAtTheEnd(last)}}
</div>

executeSomethingAtTheEnd(lastItem: boolean) {
    if (lastItem) {
       console.log('ngFor just processed the last element');
    }
}
4 Likes