I want to post some news/content on homepage and it should auto-refresh/load like a auto-refresh in Angular.
For example, consider I'm posting some content for 2 secs. The page should automatically load this content and display for user's.
I want to post some news/content on homepage and it should auto-refresh/load like a auto-refresh in Angular.
For example, consider I'm posting some content for 2 secs. The page should automatically load this content and display for user's.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Aman GuptaRank #193 · 12.4K reputationPosted Jul 29, 2021, 8:26 AM EDT
Hi Pranam,
You can try this.
import { Observable, interval, Subscription } from 'rxjs'; export class YourComponent ... { private updateSubscription: Subscription; ngOnInit() { this.updateSubscription = interval(1000).subscribe( (val) => { this.updateStats() } ); }Piyush PansuriyaRank #454 · 5.5K reputationPosted Jul 29, 2021, 2:30 AM EDT
Gurpreet AroraRank #327 · 7.6K reputationPosted Jul 29, 2021, 7:41 AM EDT