I have an angular 6 Application in which I am using Lazy loading.
The lazy loading works well.
The problem I have is that I want to load different components within my child module based on the route.
Here is my App.Routes
export const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'login', component: HomeComponent },
{ path: 'manage/:id', loadChildren: './admin/admin.module#AdminModule' },
{ path: 'organisation-list', loadChildren: './admin/admin.module#AdminModule' }
];
So for the url http:app.xxx.com/organisation-list it loads the Admin module with Routes
const routes: Routes = [
{ path: 'manage/:id', component: FlowListComponent },
{ path: 'organisation-list', component: PowerComponent },
{ path: '', component: FlowListComponent }
];
Now I was expecting the component PowerComponent to be loaded. This does not happen and instead it loads the default FlowListComponent?
I've tried various things but I think my basic understanding on how this works is wrong.
PowerComponentwould be loaded forapp.xxx.com/organisation-list/organisation-list. The child paths are added to the parent paths. - a better oliver