Bird
0
0

Which of the following is the correct way to enable preloading of all lazy modules in Angular routing?

easy📝 Syntax Q12 of 15
Angular - Performance Optimization
Which of the following is the correct way to enable preloading of all lazy modules in Angular routing?
ARouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
BRouterModule.forRoot(routes, { preload: true })
CRouterModule.forRoot(routes, { lazyLoad: true })
DRouterModule.forRoot(routes, { preloadingStrategy: NoPreloading })
Step-by-Step Solution
Solution:
  1. Step 1: Identify Angular's preloading strategy option

    Angular uses the preloadingStrategy property in router config to set preloading behavior.
  2. Step 2: Recognize the correct strategy for all modules

    PreloadAllModules is the built-in strategy to preload all lazy modules after app loads.
  3. Final Answer:

    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) -> Option A
  4. Quick Check:

    PreloadAllModules = preload all lazy modules [OK]
Quick Trick: Use preloadingStrategy: PreloadAllModules to preload all [OK]
Common Mistakes:
  • Using 'preload: true' which is invalid
  • Confusing NoPreloading with preloading all
  • Using lazyLoad option which doesn't exist

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes