Green in the picture indicates newly created files; yellow indicates changed files;
1. Create a new project
ng new angularlazyload
2. Create a user module and configure routing
ng g module module/user --routing
As shown in the picture:
3. Create user component under module/module
ng g component module/user
As shown in the picture:
4. Implement lazy loading of routes
Modify the following files in order:
#1 user-routing.module.ts