Rai*_*r34 5 routing angular angular9
我的模块中有以下路由器配置:
const publicRoutes: Routes = [
{
path: 'public',
component: PublicComponent,
children: [
{path: 'sign', component: SignComponent},
{path: '', redirectTo: '/public/sign', pathMatch: 'full'},
{path: '**', redirectTo: 'sign'},
]
},
];
Run Code Online (Sandbox Code Playgroud)
但是当我只导航到 /public 时,我没有被重定向,但是我得到了ERROR Error: ASSERTION ERROR: Type passed in is not ComponentType, it does not have '?cmp' property.
你能给我的生活带来一点光明吗?我迷路了。
小智 0
const publicRoutes: Routes = [
{
path: 'public',
component: PublicComponent,
children: [
{path: '', redirectTo: 'sign', pathMatch: 'full'},
{path: 'sign', component: SignComponent},
{path: '**', redirectTo: 'sign'}
]
},
];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5483 次 |
| 最近记录: |