Angular - Change DetectionWhich of the following is the correct way to set the default change detection strategy in an Angular component?A<code>@Component({ changeDetection: ChangeDetectionStrategy.OnPush })</code>B<code>@Component({ changeDetection: 'default' })</code>C<code>@Component({ changeDetection: ChangeDetectionStrategy.Default })</code>D<code>@Component({ changeDetection: 'Default' })</code>Check Answer
Step-by-Step SolutionSolution:Step 1: Recall Angular syntax for change detectionThe changeDetection property expects a value from the ChangeDetectionStrategy enum, not a string.Step 2: Identify correct enum usageChangeDetectionStrategy.Default is the correct enum value for default strategy.Final Answer:@Component({ changeDetection: ChangeDetectionStrategy.Default }) -> Option CQuick Check:Use enum, not string, for changeDetection [OK]Quick Trick: Use ChangeDetectionStrategy.Default enum, not string [OK]Common Mistakes:MISTAKESUsing strings instead of enum valuesConfusing 'default' with 'Default' stringMixing OnPush with default strategy
Master "Change Detection" in Angular9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More Angular Quizzes HTTP Client - Loading states and error patterns - Quiz 6medium Reactive Forms - Custom validators - Quiz 14medium Routing - RouterModule configuration - Quiz 5medium RxJS Operators - debounceTime for input throttling - Quiz 10hard RxJS and Observables Fundamentals - Why observables matter in Angular - Quiz 13medium Services and Dependency Injection - Why services are needed - Quiz 14medium Services and Dependency Injection - Service scope (root, module, component) - Quiz 12easy Template-Driven Forms - Form validation with template attributes - Quiz 5medium Template-Driven Forms - ngModel for form binding - Quiz 10hard Template-Driven Forms - Form validation with template attributes - Quiz 14medium