答案 0 :(得分:0)
您几乎拥有它!
只需用以下命令替换app-routing.module
中的主要路由配置:
const routes: Routes = [
{
path: "",
children: [
{ path: "", component: LeftMainPageComponent },
{ path: "", component: RightMainPageComponent, outlet: "righty" }
]
}
/* old config for reference
{ path: "main", component: LeftBoxComponent },
{ path: "", redirectTo: "main", pathMatch: "full" }
*/
];
基于您的代码的Stackblitz:https://stackblitz.com/edit/angular-ddc9en