Answers for "in angular when to you use setinterval"

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 "in angular when to you use setinterval"

Code answers related to "Javascript"

Browse Popular Code Answers by Language