...

/

Lazy-Loading Routes

Lazy-Loading Routes

Learn how to use lazy loading to load only certain modules to improve the user experience.

At some point, our application may grow in size, and the amount of data we put into it may also grow. The result is that the application may take a long time to start initially, or certain parts can take a long time to start. To overcome these problems, we can use a technique called lazy loading.

Lazy loading means that we don’t load all parts of our application initially. When we refer to parts, we mean Angular modules. Application modules can be separated into chunks that are only loaded when needed. There are many advantages of lazy loading a module in an Angular application:

  • Feature modules can be loaded upon request from the user.

  • Users that visit certain areas of our application can significantly benefit ...