this.fetchRequests(this) gets executed as soon as the view is initialized instead of waiting for 20 seconds.
I am aware in the older versions we have to use the wrapper but in the new versions those are not required I guess. Any help on this would be helpful.
ngAfterViewInit() {
setTimeout(()=>{
this.fetchRequests(this);
}), 10000;
}
I think you write the wrong syntax this code
setTimeout(()=>{
this.fetchRequests(this);
}), 10000;
should be like this
setTimeout(()=>{ this.fetchRequests(this); },1000);
Wrap it in zone.run().
First, import NgZone from @angular/core, and inject it into your component.
Then, modify your ngAfterViewInit to look like this:
ngAfterViewInit() {
this.zone.run(() => {
setTimeout(()=>{
this.fetchRequests(this);
}, 10000);
});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With