I have this service using HttpClient to get some data :
checkData() {
return this.http.get(\'my url\');
}
The on the footer component I
In your checkData method you could do something like this:
import { timer, of } from 'rxjs';
import { switchMap, catchError } from 'rxjs/operators';
checkData() {
return timer(0, 10000)
.pipe(
switchMap(_ => this.http.get('my url')),
catchError(error => of(`Bad request: ${error}`))
);
}
Then your subscribe will get the result of the http call every 10 seconds.