在路由定义时需要明确指定要使用的命名路由出口,并在导航时使用正确的命名路由出口名称。示例如下:
路由定义:
const routes: Routes = [ { path: 'home', component: HomeComponent }, { path: 'dashboard', component: DashboardComponent, outlet: 'sidebar' } ];
在导航时使用命名路由出口:
Dashboard
上一篇:Angular命名的router-outlet链接未工作。
下一篇:Angular命名路由出口无匹配的路由