NG.IX · Angular 22 practice question
Given this template in an Angular 22 app with incremental hydration enabled, what does Angular render during server-side rendering?
@defer (hydrate on idle) {
<app-product-reviews />
} @placeholder {
<p>Loading reviews...</p>
}
Check answer and explanation
Correct answer: Angular loads the defer block's dependencies on the server and renders the main template (<app-product-reviews />) instead of the @placeholder.
Explanation
Adding a hydrate trigger to a @defer block instructs Angular to load that block's dependencies during SSR and render its main template (<app-product-reviews />) rather than the @placeholder.
Common trap
Rendering only the @placeholder during SSR is how a standard @defer block without a hydrate trigger behaves, making it a very tempting trap. Rendering both the placeholder and the main template hidden by CSS is incorrect because Angular chooses the main template instead of the placeholder during SSR.
Source: Angular docs: Incremental Hydration — How does incremental hydration work?
Checked against the cited text on 2026-11-25.