0
0
Angularframework~5 mins

Default change detection strategy in Angular - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the Default change detection strategy in Angular?
It is the standard way Angular checks for changes in component data by running change detection on the entire component tree whenever an event happens.
Click to reveal answer
beginner
How does Angular's Default change detection strategy detect changes?
It runs a check on all components from top to bottom to see if any data has changed and updates the view accordingly.
Click to reveal answer
intermediate
When does Angular trigger the Default change detection?
Angular triggers it after events like user input, HTTP responses, timers, or any asynchronous activity.
Click to reveal answer
intermediate
What is a potential downside of the Default change detection strategy?
It can be less efficient for large apps because it checks every component on each event, even if many components did not change.
Click to reveal answer
beginner
How can you identify that a component uses the Default change detection strategy?
By default, Angular components use it unless you explicitly set the changeDetection property to ChangeDetectionStrategy.OnPush.
Click to reveal answer
What triggers Angular's Default change detection?
AUser events like clicks or typing
BOnly manual calls to detectChanges()
COnly HTTP requests
DOnly component initialization
Which statement best describes the Default change detection strategy?
AChecks only changed components
BChecks all components on each event
CDoes not check components automatically
DRuns only once at app start
How do you set a component to use the Default change detection strategy?
ASet changeDetection to ChangeDetectionStrategy.Default
BSet changeDetection to ChangeDetectionStrategy.OnPush
CNo need to set anything, it is default
DUse a special decorator
What is a common performance issue with Default change detection?
AIt only works with OnPush components
BIt skips checking some components
CIt never updates the view
DIt runs too often on all components
Which Angular feature can improve performance over Default change detection?
AOnPush change detection strategy
BManual DOM manipulation
CDisabling change detection
DUsing ngIf everywhere
Explain how Angular's Default change detection strategy works and when it runs.
Think about what happens after a button click or data load.
You got /3 concepts.
    Describe one advantage and one disadvantage of using the Default change detection strategy.
    Consider ease of use versus performance.
    You got /2 concepts.