0
0
Angularframework~5 mins

Preloading strategies in Angular - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of preloading strategies in Angular routing?
Preloading strategies help load lazy-loaded modules in the background after the app starts, improving user experience by reducing wait times when navigating.
Click to reveal answer
beginner
Name the two built-in preloading strategies Angular provides.
Angular provides NoPreloading (default, no modules preloaded) and PreloadAllModules (all lazy modules preload after app start).
Click to reveal answer
beginner
How do you enable the PreloadAllModules strategy in Angular?
In the RouterModule.forRoot() method, pass { preloadingStrategy: PreloadAllModules } as the second argument.
Click to reveal answer
intermediate
What is a custom preloading strategy in Angular?
A custom preloading strategy is a user-defined service implementing the PreloadingStrategy interface to control which modules preload based on custom logic.
Click to reveal answer
intermediate
Why might you choose a custom preloading strategy over the built-in ones?
To preload only specific modules based on conditions like user roles, network speed, or app state, optimizing performance and resource use.
Click to reveal answer
Which Angular preloading strategy loads all lazy modules immediately after app start?
ACustomPreloading
BNoPreloading
CPreloadAllModules
DLazyLoadingOnly
What is the default preloading strategy in Angular routing?
ANoPreloading
BPreloadAllModules
CCustomPreloading
DEagerLoading
How do you specify a preloading strategy in Angular routing configuration?
AIn the RouterModule.forRoot() options
BIn the module imports array
CIn the component decorator
DIn the main.ts file
What interface must a custom preloading strategy implement?
AOnInit
BResolve
CCanActivate
DPreloadingStrategy
Which scenario best fits using a custom preloading strategy?
APreload all modules regardless of conditions
BPreload modules based on user permissions
CLoad modules only on navigation
DNever preload any modules
Explain what preloading strategies are in Angular and why they matter.
Think about how apps load parts in the background to be ready faster.
You got /3 concepts.
    Describe how to implement a custom preloading strategy in Angular.
    Focus on the interface and where to configure it.
    You got /3 concepts.