title: clearinterval not working inside ngOnDestroy()
body: <p>My ngOndestroy is calling with other route navigation but it is not executing clearInterval inside the method. Where am I making it wrong? It is running in background while i am in other component.</p>
  
  <pre><code>timer:any;
  
  ngOnInit() {
    this.timer= this.interval();
  };
  
   ngOnDestroy(){
      clearInterval(this.timer);
     console.log("Inside Destroy");
  
  
   }
  
  interval(){
    setInterval(()=&gt;{
      this.getData();
    },20000)
  }
   getData(){
     this.dataservice.getdata()
        .subscribe(users=&gt;{
        this.datas=users;
        console.log(this.datas);
      })
   }
  </code></pre>