Bird
0
0

How can you lazy-load a feature module named ReportsModule to improve app startup time?

hard📝 Application Q9 of 15
Angular - Modules
How can you lazy-load a feature module named ReportsModule to improve app startup time?
AConfigure Angular Router with loadChildren pointing to ReportsModule path
BImport ReportsModule directly in AppModule imports array
CDeclare ReportsModule components in AppModule declarations
DAdd ReportsModule to bootstrap array in AppModule
Step-by-Step Solution
Solution:
  1. Step 1: Understand lazy loading

    Lazy loading uses Angular Router's loadChildren to load modules on demand.
  2. Step 2: Check options

    Only Configure Angular Router with loadChildren pointing to ReportsModule path correctly describes lazy loading setup. Others import eagerly or misuse module properties.
  3. Final Answer:

    Configure Angular Router with loadChildren pointing to ReportsModule path -> Option A
  4. Quick Check:

    Lazy load with loadChildren in router = C [OK]
Quick Trick: Use loadChildren in routes to lazy-load feature modules [OK]
Common Mistakes:
  • Importing lazy modules eagerly in AppModule
  • Declaring feature module components in AppModule
  • Adding feature modules to bootstrap array

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes