Lazy loading is one of the most useful concepts of Angular Routing. It helps us to download the web pages in chunks instead of downloading everything in a big bundle. It is used for lazy loading by asynchronously loading the feature module for routing whenever required using the property loadChildren. Let’s load both Customer and Order feature modules lazily as below:
const routes: Routes = [
loadChildren: () => import('./customers/customers.module').then(module => module.CustomersModule)
loadChildren: () => import('./orders/orders.module').then(module => module.OrdersModule)
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.