I have a github project which would explain the issue
const routes: Routes = [
{
path: 'admin',
loadChildren: './admin/admin.module#AdminModule'
},
{
path: '',
component: HomeComponent
}
];
this is from admin module routing
const routes: Routes = [{
path: '',
component: OverviewComponent
},
{
path: 'users',
component: UserComponent
}];
This project has home component with no paths in url
http://localhost:4200 but it is loading empty path (OverviewComponent) defined in admin module which is lazy loaded.
As per my understanding all the lazy loaded url path should be
http://localhost:4200/admin (should load overview component). http://localhost:4200/admin/users (should load users component)
I see url paths are working even there is no module prefix.
- http://localhost:4200 (this is loading overview instead of home component)
- http://localhost:4200/users (this is loading user component instead of throwing error.)
Thanks in advance.