score:5

Accepted answer

There is a function on the SimpleChange object passed into ngChanges called isFirstChange which you can use to check if the change was before initialization (it will be true).

score:0

So yeah, waiting for ViewInit is actually the only safe way to guarantee that e.g. Viewchilds are ready. This has nothing to do with isFirstChange. Wrong Lifecycle hook. isFirstChange = false maybe means the component is initialised, but OP asked for AfterViewInit

so my kinda cumbersome way of doing this is to create an observable. (of course you then have to unsubscibe on destroy maybe via an other observable but this is out of scope of this question.)

viewInit$ = new ReplaySubject();

ngOnChanges(){
    this.viewInit$.subscribe(()=>{
    // do something after View Init
    })
}

ngAfterViewInit(){
    this.viewInit$.next()
}

Related Query

More Query from same tag