1
votes

I am reading an article about lazy loading in Angular.

Can anyone explain to me the purpose of "#LazyModule" in the below route?

const routes: Routes = [ { path: 'lazy', loadChildren: './lazy.module#LazyModule'} ];

original article: https://angularfirebase.com/lessons/how-to-lazy-load-components-in-angular-4-in-three-steps/

2
Actually, it is not the word, it is the Class name of that .ts file to be loaded. - Rohit.007

2 Answers

2
votes

#<module_name> is the name of the module's class

export class LazyModule{ }
2
votes

It is not the word, it is the class name of that .TS file to be lazily loaded.

example.

const routes: Routes = [
  {
    path: 'customers',
    loadChildren: './customers/customers.module#CustomersModule'
  },
  {
    path: 'orders',
    loadChildren: './orders/orders.module#OrdersModule'
  },
  {
    path: '',
    redirectTo: '',
    pathMatch: 'full'
  }
];

in customers.module.ts class CustomersModule{}

So in your case it will be class LazyModule{}