I have two component in my angular 2 application : component A (parent) and component B (child).
When i passe data (myData) from A to B with @Input() i get my data in my B (child component), but the problem is that the child component loads BEFORE myData and i got indefined, the only way a can console.log(myData) is in ngOnDestroy hook !
How to deal with this kind of load order ?
ngOnChanges()which is called every time the@Input()is updated from the outside.ngOnInit()is called after the first timengOnChanges()is called. If that doesn't work then please provide more code that demonstrates what you try to accomplish. I can't now what's going on on your site without seeing the code. - Günter Zöchbauer