0
0
Angularframework~5 mins

Dynamic component loading in Angular - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is dynamic component loading in Angular?
Dynamic component loading means creating and inserting components into the app at runtime, not just when the app starts. It lets you add parts of the UI only when needed.
Click to reveal answer
beginner
Which Angular service is commonly used to load components dynamically?
The ViewContainerRef service is used to create and insert components dynamically into the view.
Click to reveal answer
intermediate
What is the role of ComponentFactoryResolver in dynamic component loading?
It helps create a factory for the component you want to load dynamically. This factory is then used to create the component instance.
Click to reveal answer
intermediate
How do you clean up a dynamically loaded component in Angular?
You call the destroy() method on the component reference to remove it and free resources.
Click to reveal answer
beginner
Why use dynamic component loading instead of static components?
It improves performance by loading components only when needed, and allows flexible UI changes without rebuilding the app.
Click to reveal answer
Which Angular directive is used as a placeholder to insert a dynamic component?
A<ng-template>
B<div>
C<component>
D<router-outlet>
What method on ViewContainerRef inserts a component dynamically?
AinsertComponent()
BappendChild()
CloadComponent()
DcreateComponent()
Which Angular version introduced the simplified dynamic component loading without ComponentFactoryResolver?
AAngular 9
BAngular 13
CAngular 14
DAngular 16
What is the type of object returned when you create a dynamic component?
AComponentRef
BElementRef
CViewRef
DTemplateRef
Which Angular feature helps to pass data to a dynamically loaded component?
ARouter parameters
BInput properties
CDirect DOM manipulation
DServices only
Explain how to load a component dynamically in Angular step-by-step.
Think about the services and methods Angular provides for dynamic loading.
You got /5 concepts.
    Describe benefits and use cases for dynamic component loading in Angular apps.
    Consider why you might not want to load all components at once.
    You got /4 concepts.