title: Routing using button click function in Angular Js 2
body: <p>I'm angular js 2 beginner.I'm trying to do the login page and on clicking "Signin" button the page should navgiate to next page.
  On clicking the button I tried to display an alert and its working.But I tried to navigate It shows Error as "app.component.ts (18,1): Cannot find name 'navigateUrl'." I want to know where the code causes error.</p>
  
  <p><strong>Codes</strong> :</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 } from '@angular/core';
  import { Router } from '@angular/router';
  @Component({
    selector: 'app-root',
    templateUrl:'app.component.html'
  })
  
  export class AppComponent {
  
  hello ={username:'yyy',password:'zzz'};
  navigateUrl():void{
  this.router.navigate(['/lazy.html']);
  
  }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
  &lt;div class="container text-center"&gt;
          &lt;h3&gt;Login&lt;/h3&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-md-12"&gt;
                  &lt;input class="text-center" type="text" placeholder="Username" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row margin-t-20"&gt;
              &lt;div class="col-md-12"&gt;
                  &lt;input class="text-center" type="password" placeholder="Password" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
     &lt;div class="row margin-t-20"&gt;
      &lt;input class="btn-primary text-center " type="button" (click)="navigateUrl()" value="Sign in" /&gt;
    &lt;/div&gt;
          &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>