A brief discussion about Lazy Loading in Angular.
Today, In this blog, we are going to discuss the Lazy Loading in Angular. We will see what is lazy loading with example.
It improves application load time speed by splitting the application into many bundles. When the user navigates by the app, bundles are loaded as needed.
Lazy loading facilitates asynchronously loading the feature module for routing whenever required using the property loadChildren.
Below is the example of lazy loading, where both Customer and Order features loading lazily.
const routes: Routes = [
loadChildren: () => import(‘./customers/customers.module’).then(
module => module.CustomersModule)
loadChildren: () => import(‘./orders/orders.module’).then(module => module.OrdersModule)
So, thanks for following this blog, and if you need any help please leave your queries in the comment box we will be happy to help you.