Do you have any idea what might be wrong with my configuratoin if my second router-outlet is always ignored? This here is my app.module routing (app.component has one router-outlet):
const routes: Routes = [
{
path: 'home',
loadChildren: './home/home.module#HomeModule',
canLoad: [AuthorizationGuard]
},
{
path: 'please-login',
component: PleaseLoginComponent
},
{
path: '**',
redirectTo: 'please-login'
}
];
And here is my home.module-routing (HomeComponent has another router-outlet):
RouterModule.forChild([
{
path: '',
pathMatch: 'full',
component: HomeComponent,
children: [
{
path: 'welcome',
component: WelcomeComponent
}
]
},
{
path: '**',
redirectTo: 'welcome'
},
{
path: 'Data',
loadChildren: '@libs/data#DataModule'
}
]),
I can load DataModule with no problems; it directs me to /home/data/blabla. But (!) it inserts DataComponent into the first router-outlet. The second one (and thus the whole HomeComponent which is supposed to surround DataComponent) is ignored. That is, unless I navigate to /home, then it is displayed, but as expected, with no DataComponent inside. Meaning I can use both components only exclusively and not nested.
I tried using named outlets, but to no success. When I trace-log the router-state, the resolves seem to be ok, so I am a bit lost here