how to reload again and again in angular 8 with specific time code example
Example: refresh data after some time angular
import { Subscription, timer } from 'rxjs';
import { switchMap } from 'rxjs/operators';
subscription: Subscription;
statusText: string;
ngOnInit() {
this.subscription = timer(0, 10000).pipe(
switchMap(() => this.myservice.checkdata())
).subscribe(result => this.statustext = result);
}
ngOnDestroy() {
this.subscription.unsubscribe();
}