I have tried all the life cycle hooks but can\'t get to accomplish the needed result. The result that I need is triggering a function that initialize many jquery plugins us
One possible solution would be subscribing on zone.onStable or zone.onMicrotaskEmpty
ngAfterViewInit() {
this.zone.onStable.first().subscribe(() => {
debugger;
});
}
or
ngOnInit() {
this.service.getData().subscribe(() => {
this.data = data;
this.zone.onMicrotaskEmpty.first().subscribe((data) => {
$(someElem).plugin();
});
});
}
See also