title: Uncaught (in promise): Error: Cannot match any routes. URL Segment: Angular
body: <p>I am new to Angular. I am using Angular 7 and doing a  simple routing.
  After Login page, I want to display a home page. Login is a part of <code>app-root</code> component and in home page I am showing <strong>header</strong> and <strong>sidenav</strong> but I am not able to route to home page.</p>
  
  <p><strong>app-routimg.module.ts</strong></p>
  
  <pre><code>const appRoutes: Routes = [
    {
      path: '',
      loadChildren: './login/login.module#LoginModule'
  },
    {
      path: 'dashboard',
      loadChildren: './dashboard/dashboard.module#DashBoardModule',
  
  }
  ];
    @NgModule({
      imports: [RouterModule.forRoot(appRoutes)],
      exports: [RouterModule],
     // providers: [AuthGuard]
  }
  </code></pre>
  
  <p><strong>dashboard-routing.modul.ts</strong></p>
  
  <pre><code>const appRoutes: Routes = [
    {
      path: 'dashboard',
      component: DashBoardComponent ,
      children: [
           {
               path: '',
              redirectTo: 'home'
          },
          {
              path: 'home',
              loadChildren: './home/home.module#HomeModule'
          },
  
      ]
  }
  ];
  @NgModule({
    imports: [
      RouterModule.forChild(appRoutes)
    ],
    exports: [
      RouterModule
    ]
  })
  </code></pre>
  
  <p><strong>login.component.ts</strong></p>
  
  <pre><code>onSubmit() {
  
         this._router.navigate(['/home']);
        }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/e1McS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e1McS.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>core.js:15724 ERROR Error: Uncaught (in promise): Error: Cannot match
    any routes. URL Segment: 'home' Error: Cannot match any routes. URL
    Segment: 'home'</p>
  </blockquote>