NG.III · Angular 22 practice question

A developer is implementing a lazy-loaded widget using `@defer`. They want to display a loading spinner immediately while the widget data fetches. If they include an `@placeholder` block, what is the key characteristic regarding the placeholder's dependencies?

@defer { 
  <HeavyWidget /> 
} @placeholder { 
  <Spinner /> 
}
Choose one answer
Check answer and explanation

Correct answer: The dependencies required by the placeholder block are loaded immediately when the component initializes, regardless of when the `@defer` block triggers.

Explanation

The accurate description is that 'The dependencies required by the placeholder block are loaded immediately when the component initializes, regardless of when the `@defer` block triggers,' because the documentation specifies that 'dependencies of the placeholder block are eagerly loaded.'

Common trap

The description stating 'The placeholder content is only rendered after the main widget successfully loads, providing a visual cue during the fetch' describes a behavior more akin to standard lazy loading without a placeholder, and the statement 'The placeholder content is rendered asynchronously, meaning its loading time is dependent on the widget's network latency' incorrectly implies the placeholder's rendering is governed by the main content's network timing.

Source: Angular docs: Deferred loading with `@defer` — Show placeholder content with `@placeholder`
Checked against the cited text on 2026-11-25.

Report an error in this question