Angular Routing ParentComponent Hack

Date: 2020-01-22

Source: Christian, https://christian.solidt.eu/wordpressblog/

routes.push(
    {
        path: "",
        component: ViewWithHeaderComponent,
        children: [{
            path: "component-with-header",
            component: SubComponent
        }]
    },
    {
        path: "",
        component: ViewWithoutHeaderComponent,
        children: [{
            path: "component-without-header",
            component: SubComponent
        }]
    }
);

ViewWithHeaderComponent:

<header-component><header-component>
<router-outlet></router-outlet>

ViewWithoutHeaderComponent:

<router-outlet></router-outlet>
31940cookie-checkAngular Routing ParentComponent Hack