How would you implement lazy loading for an Angular feature module?

This tests route-level code splitting and CLI workflows. A great answer hits: ng generate module, loadChildren in the route config, and excluding the feature from AppModule. A red flag is suggesting manual chunking instead of router-driven lazy loading.
This tests Angular route-based code splitting, CLI schematics, and the module graph. A strong answer covers generating a module with ng generate module Name --route=name --module=app, replacing the eager import with loadChildren in the route array, and removing the feature from AppModule so the bundler creates a separate chunk. A red flag is confusing standalone loadComponent with NgModule loadChildren, or suggesting manual Webpack config instead of the router's built-in lazy loading.
Read the original → angular.dev
- #angular
- #lazy-loading
- #routing
- #cli
- #performance
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.