0
我使用此代码为路由 - >角使用2路由LoadChildren
{ path: 'dashboard', loadChildren: './dashboard#DashboardModule'},
在我的仪表板模块我用这 - >
{ path: '', children: [
{ path: '', component:DashboardComponent ,
children:[
{ path: '', redirectTo:'dashboard/first',pathMatch:'full' },
{ path: 'first', component: FirstComponent },
{ path: 'second', component: SecondComponent },
]
},
]},
这里当网址/仪表板我需要它路由到/仪表板/第一..
我该如何实现它?
尝试'redirectTo: 'first'',而不是'redirectTo:' 仪表盘/ first'' – AngularChef
它在哪儿你说了redirectTo:第一,而不是redirectTo: '仪表盘/第一'? –
错误...在您提供的代码中。感谢好友 – AngularChef