title: Angular2: create and destroy timer
body: <p>I am trying to create timer, that will send GET request every 5 seconds, I manage to do it, but I notice that if I move to different page (routing) the timer still running, so I tried to add ngOnDestroy, but I don't have the "unsubscribe" method</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import {Component, OnInit, OnDestroy} from '@angular/core';
  import {Observable} from 'rxjs/Rx';
  
  @Component({
    templateUrl: 'app/pages/CurrentRuns/currentruns.component.html'
  })
  
  
  
  
  export class CurrentRunsComponent implements OnInit, OnDestroy {
    private timer;
     ticks=0;
      
  
    ngOnInit() {
      this.timer = Observable.timer(2000,5000);
      this.timer.subscribe(t =&gt; this.tickerFunc(t));
    }
      tickerFunc(tick){
      console.log(this);
      this.ticks = tick
    }
  
     ngOnDestroy(){
      console.log("Destroy timer");
  
    }
  }
  
    </code></pre>
  </div>
  </div>
  </p>
  
  <p>I am using angular2 RC7, "rxjs": "5.0.0-beta.12"</p>