Within my app-module I have three feature modules “desktop”, “info”, “shared”. The desktop-module contains the info-module and the shared-module. The info-module contains the imprint-component and the shared-module contains the foot component:
app
├── desktop
│ ├── desktop-routing.module.ts
│ ├── ...
│ ├── info
│ │ ├── ...
│ │ ├── info-routing.module.ts
│ │ └── imprint
│ │ ├── imprint.component.html
│ │ └── ...
│ └── shared
│ ├── foot
│ │ ├── foot.component.html
│ │ └── ...
│ └── shared-component.module.ts
├── ...
└── app-routing.module.ts
The routes in the app-routing.module are:
const routes: Routes = [
{ path: '', redirectTo: 'desktop', pathMatch: 'full' },
{ path: 'desktop', loadChildren: () => import('./desktop/desktop.module').then(m => m.DesktopVersionModule) }
];
I imported the shared module into the desktop-module and into the info-module. And lazy-load the info-module within desktop-module:
const routes: Routes = [
{ path: '', component: DesktopVersionComponent },
{ path: 'info', loadChildren: () => import('./info/info.module').then(m => m.InfoModule) }
];
The desktop.component.html contains the selector of the foot-component <app-foot></app-foot>
that includes the foot template into the desktop template. The foot template contains a link to the imprint-component from the info module:
<span class="default-link" routerLink="info/imprint">Impressum</span>
The routes of info-routing.module.ts file are:
const routes: Routes = [
{ path: '', component: InfoComponent,
children: [
{ path: 'imprint', component: ImprintComponent },
]
}];
When i serve the app and click on routerLink="info/imprint"
, then the link is not resolved routerLink="doesn't/matter/what/the/link/is"
. No warning or error, no console output. Which piece is missing so that the system will resolve the link?