What is Lazy Loading?
Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program’s operation if properly and appropriately used.
In Angular, Lazy Loading used to load the modules asynchronously. For a large application, Lazy Loading is mainly used. Also, Lazy Loading used to improve the application performance. Because it will load modules whenever required.
So, In angular based on route changes, we can load the modules asynchronously.
Example:
Const Route : [
{ path: 'user', loadChildren:'./user/user.module#UserModule' }
]
Using LoadChildren
We can load the module based on route changes