For Angular Developers - What is Angular Lazy Loading? and How to Implement?

Published: 20 May 2020
on channel: Opal Infotech
200
2

Hello, I am Chitrang from Opal Infotech. Today i am going to explain about the most important feature of Angular - lazy loading

Lazy loading is the process of loading modules (images, videos, documents, JS, CSS, etc) on-demand.

So, by using the lazy loading we are going to take care of 2 Major aspects of the website speed 1) Initial response time 2) Resource Usage.

Common mistake done by majority developers is that they load all components on the main module while developing the angular website. Due to this when the code is compiled for deployment all the resources are combined to the main file if it is used OR not used during the page displayed. eg If you have a simple website where there are only 2 pages Home page and Contact page. If you added both the components in the app.module then while compiling, Angular compiler will create one single js file & css file include all the content to that. Due to this the loading time will increase and also the resource used to download files will be used more.

But if we have used the Lazy loading and generated the different module for Home and contact. Due to this when we have compiled the code it will split the JS, CSS.

Due to this when a user loads the page it will load only 50% of the data compared to the above scenario and because of this the page response time and the Resources used during the page load will be less and we can achieve a much faster website.

How to implement lazy loading for angular. Please follow instruction on https://angular.io/guide/lazy-loading...

Thank you for watching this video. If you have any query please email on [email protected] OR visit our website www.webmasterindia.com


Watch video For Angular Developers - What is Angular Lazy Loading? and How to Implement? online without registration, duration hours minute second in high quality. This video was added by user Opal Infotech 20 May 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 20 once and liked it people.