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).


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();

    // do something after View Init


Related Query

More Query from same tag