title: Angular 4 Router return undefined
body: <p>I try to make a function that using <code>Router.navigate({})</code></p>
  
  <p>Importing Router:</p>
  
  <pre><code>import { Router }   from '@angular/router';
  </code></pre>
  
  <p>The class with the functions and the constructor:</p>
  
  <pre><code> export class HomeComponent implements OnInit {
    constructor(private router:Router,private renderer: Renderer2,public but2: ElementRef, public but1: ElementRef) {
    }
  
    ngOnInit() {
    }
    nvgt(lc){
      this.router.navigate([ lc ]);
    }
    navigator(loc) {
    this.renderer.setStyle(this.but1.nativeElement.querySelector('#but1'),'animation','fadeoutdown 1s both');
    this.renderer.setStyle(this.but2.nativeElement.querySelector('#but2'),'animation','fadeoutup 1s both');
    window.setInterval(this.nvgt,1500,loc)
    }
  }
  </code></pre>
  
  <p>The component HTML(2 buttons):<br></p>
  
  <pre><code>&lt;button #but1 id="but1" (click)="navigator('/questions')" mat-raised-button&gt;Search for my next phone&lt;/button&gt;
  &lt;hr data-content="OR"&gt;
  &lt;button #but2 id="but2" (click)="navigate('/inputphone')" mat-raised-button&gt;Search specific phone&lt;/button&gt;
  </code></pre>
  
  <p>When I click the next error found in the console:<br></p>
  
  <pre><code>ERROR TypeError: Cannot read property 'navigate' of undefined
      at HomeComponent.nvgt (webpack-internal:///../../../../../src/app/home/home.component.ts:25)
      at ZoneDelegate.invokeTask (webpack-internal:///../../../../zone.js/dist/zone.js:421)
      at Object.onInvokeTask (webpack-internal:///../../../core/esm5/core.js:4940)
      at ZoneDelegate.invokeTask (webpack-internal:///../../../../zone.js/dist/zone.js:420)
      at Zone.runTask (webpack-internal:///../../../../zone.js/dist/zone.js:188)
      at ZoneTask.invokeTask (webpack-internal:///../../../../zone.js/dist/zone.js:495)
      at ZoneTask.invoke (webpack-internal:///../../../../zone.js/dist/zone.js:484)
      at timer (webpack-internal:///../../../../zone.js/dist/zone.js:2065)
  </code></pre>