title: How to navigate to other page in angular 6?
body: <p>Im trying to redirect my page from login to another page. Im following this code.</p>
  
  <p>My login component ts file:</p>
  
  <pre><code>import { Router } from '@angular/router';
  
  constructor(private router: Router) {
  }
  
  funLogin(mobilenumber){
      this.router.navigateByUrl('registration');
  }
  </code></pre>
  
  <p>In my html Im calling this function in a submit btn,</p>
  
  <pre><code>&lt;button class="common-btn btn" (click)="funLogin(mobileNo.value)"&gt;Submit&lt;/button&gt;
  
  In my app.login.routing file,
   export const loginRouting: Routes = [
  {
   path: '', component: DashboardRootComponent, canActivateChild: [],
      children: [
          { path: '', component: DashboardComponent, pathMatch: 'full' },
          { path: 'home', component: HomeComponent },
          { path: 'registration', component: RegistrationComponent },
      ]
     }
    ]
  </code></pre>
  
  <p>I have tried with "this.router.navigate" &amp; referredlot of links. But it didnt work. Can anyone please tell me where Im going wrong or if you could give me a workingh sample it would be better.</p>