I have the following method in one component:
ngOnInit() { this.battleInit(); setInterval(() => { this.bat
every 40 seconds
polling: any; ngOnInit() { this.consulta(); this.pollData(); } pollData () { this.polling = setInterval(() => { this.consulta(); },40*1000) ngOnDestroy() { clearInterval(this.polling); }