NG.III · Angular 22 practice question
A developer has a component, `LazyFeatureComponent`, which is not marked as standalone. They place this component inside an Angular `@defer` block in a parent template. What is the expected loading behavior for `LazyFeatureComponent`?
<div *ngIf="shouldLoad"><ng-container *defer="whenReady"><app-lazy-feature></app-lazy-feature></ng-container></div>
Check answer and explanation
Correct answer: The component will be eagerly loaded because it is not a standalone entity, regardless of its placement within the defer block.
Explanation
The component will be eagerly loaded because it is not a standalone entity, regardless of its placement within the defer block.
Common trap
The suggestion that 'the component will be deferred, but its transitive dependencies might still load upfront' is misleading because the primary dependency itself must satisfy the standalone requirement to be deferred.
Source: Angular docs: Deferred loading with `@defer` — Which dependencies are deferred?
Checked against the cited text on 2026-11-25.