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();
}
Also in JavaScript:
- professional react projects
- js loop through associative array
- how get parent element javascript
- node_modules/react-native-paper/lib/module/core/Provider.js
- filter an array of objects and match its key with values inside another array
- conditional style react
- javascript redirect with extra url arguments
- pass header in ajax
- document.body.style.background
- express ssl
- select class with data attribute jquery
- hex string to int javascript
- javascript empty function
- get installed plugins in a browser via javascript
- emmet react self closing tags
- send message to all servers discord.js
- Count frequency of array elements js
- add dev dependency yarn
- "@testing-library/jest-dom"
- rxjs coding example
- question mark and colon in javascript
- view background image in react native
- get radio button value javascript
- video recorder using webrtc and javascript