Angular ルーティングとルーティングのデバッグ

● Angular ルーティング

次の ルーティングを指定します

/heroes
/users/home
/admin/home (lazyloading)
const routes: Routes = [
  { path: 'heroes', component: HeroesComponent } ,
  { path: 'users',
    children: [
      { path: 'home', component: HomeComponent },
    ]
  } ,
  { path: 'admin',
    children: [
          { path: '', loadChildren: './user-list/user-list.module#UserListPageModule' },
          { path: ':userId', loadChildren: './user-detail/user-detail.module#UserDetailPageModule' },
    ]
  } ,
];

● Angular ルーティングのデバッグ

src\app\app-routing.module.ts

imports: [ 
	RouterModule.forRoot(routes) 
],

  ↓   { enableTracing: true } を追加します。

imports: [ 
	RouterModule.forRoot(routes, { enableTracing: true }) 
],
No.1857
09/23 17:31

edit