title: Cannot read property 'navigate' of undefined error
body: <p>below is my code for navigation</p>
  
  <pre><code>         export class AppComponent {
             router:Router
              doSwipe(direction: string){
  
                 this.router.navigate(['/article']);
              }
         }
  </code></pre>
  
  <p>I am getting Cannot read property 'navigate' of undefined error.pls help to fix it</p>