Home > Net >  All except one module doesn't load in lazy loading
All except one module doesn't load in lazy loading

Time:04-11

I wrote the below code for lazyloading. All the modules except EmployerModule load well when I go to their corresponding routes. Can you please tell me what I am doing wrong

const routes: Routes = [
  {
    path: 'login',
    loadChildren: () =>
      import('./login/login.module').then((c) => c.LoginModule),
  },
  {
    path: 'home',
    loadChildren: () =>
      import('./login/home.module').then((c) => c.HomeModule),
  },
  {
    path: 'employer',
    loadChildren: () =>
      import('./employer/employer.module').then((c) => c.EmployerModule),
  },
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
})
export class AppRoutingModule {}

CodePudding user response:

Lazy loading routes example might be helpful.

Click Here..

  • Related