Table of Contents
When we open an Angular application in our system, it is important to know how long it takes to open the application, how long it takes to get ready, how long does it take for the user to interact with the application, and how long will it take for the modules of our application to download in their local system. Only after all the modules are loaded in the user’s system can we use the application. In this type of scenarios, we can use 3 types of strategies which are given below:
- Eager Loading
- Lazy Loading
- Pre Loading
1). Eager Loading :
In this type of strategy, the module first downloads all components, services, directives, and pipes contained in the module into the user’s system, and then our application starts, that’s why every time we start an application, it takes time for the application to start.

Advantages of Eager Loading :
- Once all the components are downloaded once the application will be able to work smoothly.
- This strategy is useful for small applications which do not have such big details or modules.
Disadvantages of Eager Loading :
- The main disadvantage of this strategy is that if not all modules are downloaded to the user’s system, the user will have to wait for the application to load.
- This strategy is not used in big applications just because of bad user experience.
2). Lazy Loading :
In a lazy loading strategy, we will keep the module of component, service, pipe, and directive which is required at that time of application loading, and then the remaining modules can be loaded as required.

Advantages of Lazy Loading :
- Any large application can load as many modules as it needs.
- In a large application that has more modules, we can use this strategy to increase the user experience.
Disadvantages of Lazy Loading :
- The details of that module will be downloaded at the time of going to each module, so the user has to wait for the application to load at that time which can be called a bad user experience.
3). Pre Loading :
During lazy loading, the user first loads the application module then goes to the user module which has more details of the module on the pre-loading strategy can be used at this time. We can only do pre-loading when we have used our application lazy loading.

Advantages of Lazy Loading :
- Any large application and small application can use this strategy.
Disadvantages of Lazy Loading :
- We must know about the lazy loading strategy and if we implement lazy loading first in the application then we can use preloading for the application.
In conclusion, loading module strategies play a crucial role in Angular development. As an experienced Angular development company, we understand the significance of optimizing module loading to enhance the performance and user experience of web applications.