我为Angular项目定义了一个路由器。我的路由器配置如下:
export const routes: Routes = [
{
path: '',
component: AppComponent,
},
{
path: 'hello',
component: HelloComponent,
},
];
export const routing: ModuleWithProviders = RouterModule.forRoot(routes, { enableTracing: true });
当我运行项目时,我看到按以下顺序触发路由器生命周期事件:
在此列表中,我也看到了Child Activation Start和Child Activation End事件。但是,我没有儿童路线。为什么这些事件会引发呢?
要查看路由器事件的运行情况,请检查以下链接的控制台输出:
https://stackblitz.com/edit/angular-khjkwg?file=app%2Fapp.routing.ts
感谢。