Answer the question
In order to leave comments, you need to log in
How to make a component wait for data to load?
There is a component (a graph that is drawn according to the given data), the data for drawing is transmitted using @Input. The component draws the SVG path when it is initialized (the usual chart() method is called).
ngOnInit(){
this.chart();
}
Answer the question
In order to leave comments, you need to log in
Hello. If I understood your problem correctly, then you'd better look towards OnChanges . This way you can also redraw charts if the incoming data has changed.
As a tip, don't forget to make a destroy() method for your charts and call it in OnDestroy .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question