In my Angular 11 project I have an Observable what changes the view and take some times while it's rendering.
Something like this:
export class MyComponent implements OnInit {
myObservable = of([1, 2, 3]);
constructor() { }
ngOnInit(): void {
this.myObservable.pipe(
// here is some functions
).subscribe();
}
}
After ngOnInit
ran the observable still running and processing datas. After datas arrived the pipe change the template. But this change happening after ngAfterViewInit
finished. So I need a soultion what run after pipe AND the rendering finished what is happening because pipe is finished.
How can I run codes (tooltip initialization) after my observable and the caused rendering is finished?
The ngAfterViewChecked
not a good solution because it's always run when the view is changing, and my tooltip initialization will change the view too. So I want to run this initialization only once.
Is there any solution?