I am new in Angular. I am trying to implement lazy loading with multiple component. Its lazy load home component properly but it fails to load another components.
It throws below error:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'admin'
app.routing.ts
{
path: '',
component: SiteLayoutComponent,
children:
[
{
path: 'home',
loadChildren: './lazymodules/lazy.module#LazyModule',
},
]},
lazy-routing.module.ts
const routes: Routes = [
{
path: '', component: HomeComponent,
}
,
{
path: 'admin', component: AdminComponent,
},
{ path: 'settings', component: SettingsComponent },
{ path: 'about', component: AboutComponent }];
I have created similar sample application on stackblitz. Anybody please hep here.
Thanks in advance