Router navigate to child route - Angular 6

后端 未结 6 625
半阙折子戏
半阙折子戏 2021-01-17 21:54

I\'ve defined my routes like this:

const routes: Routes = [
    { path: \'\', loadChildren: \'./tabs/tabs.module#TabsPageModule\' },
    { path: \'faq\', lo         


        
6条回答
  •  失恋的感觉
    2021-01-17 22:26

    I found solution by adding profile path below '' and 'tabs' path:

      {
        path: 'profile',
        redirectTo: '/tabs/(profile:profile)',
        pathMatch: 'full'
      }
    

    Now I am able to navigate to profile with

      this.router.navigate(['profile']);
    

    I forgot to add this path in tabs.router.module.ts. Because of that I was getting mentioned error

提交回复
热议问题