Answers for "setinterval not working in angular 9"

0

setinterval in angular 6

ngOnInit() {
  this.battleInit();
  this.id = setInterval(() => {
    this.battleInit(); 
  }, 5000);
}

ngOnDestroy() {
  if (this.id) {
    clearInterval(this.id);
  }
}
Posted by: Guest on June-16-2020

Code answers related to "setinterval not working in angular 9"

Code answers related to "Javascript"

Browse Popular Code Answers by Language