1

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 {}
1
  • How did you arrive at conclusion that this module is not loading as expected and others are! Commented Apr 8, 2022 at 19:25

1 Answer 1

2

Lazy loading routes example might be helpful.

Click Here..

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.