What is lazy loading and How to enable lazy loading in angular 2?
Lazy Loading - Lazy loading enables us to load only the module user is interacting and keep the rest to be loaded at run-time on demand.
Lazy loading speeds up the application initial load time by splitting the code into multiple bundles and loading them on demand.
1. Each and every Angular2 application must have one main module that is called “AppModule” and your code should be splitted into various child modules based on your applications.
2. We do not require to import or declare lazily loading module in root module.
3. Add the route to top level routing and takes routes array and configures the router.
4. Import module specific routing in the child module.
5. And so on.
I hope you are enjoying with this post! Please share with you friends. Thank you!!