且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

名称不正确的嵌套路由器插座

更新时间:2022-12-25 12:45:48

在desktop.module.ts中,您需要导出RouterModule

in desktop.module.ts you need to exports the RouterModule

@NgModule({
    imports: [
        CommonModule,
        IonicModule,
        RouterModule.forChild(routes)
    ],
    declarations: [WorkoutComponent, DesktopComponent],
    exports: [RouterModule]
})

,您应该像这样进行导航(尝试使用您的方式,如果仍然无法运行,请尝试以下操作):

and you should navigate like this (try ur way, if still not working try this):

[routerLink]="['/d/workout']"
routerLink="/d/workout"