×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Nilesh Yadav
Added: Dec 16, 2017 12:10 PM
Views: 4
Tags: no tags
  1. ngOnInit() {
  2.   this.battleInit();
  3.   this.id = setInterval(() => {
  4.     this.battleInit();
  5.   }, 5000);
  6. }
  7.  
  8. ngOnDestroy() {
  9.   if (this.id) {
  10.     clearInterval(this.id);
  11.   }
  12. }