Rendering & reactivity

DOM rendering & hooks

Mount a cart row, change its quantity, and destroy it. Inspect the hooks and DOM text recorded in each pass.

Angular 22.3.2 · trace
Lesson flow Fixture host. Row input. Lifecycle hooks. DOM text.
Fixture host
Row input
Lifecycle hooks
DOM text

Objective

Observe initialization, recurring checks, DOM updates, and cleanup in a real Angular component.

Transcript

Angular 22.3.2

  1. The browser fixture creates a cart row and provides the initial quantity. Its first input change precedes the initialization hook.
  2. An explicit check runs the content and view hooks. The fixture reads the DOM text after the check returns.
  3. Changing the quantity triggers another input change and the recurring checks. Initialization hooks run once for this component instance.
  4. A second explicit check with the same input runs the check hooks again. The rendered quantity stays the same.
  5. Destroying the row runs its destroy hook and registered cleanup. The fixture checks that its element was removed.
  6. The conditional scenario records parent and child separately, reads a projected note, and mounts a fresh child after removal through @if.
  7. The render callback scenario records separate write and read phases and observes an updated signal after rendering. These browser callbacks do not measure paint.
  8. On a direct page load, the hydration fixture records the counter element before Angular starts and compares it after the first client render. Reload this page directly to capture both versions.

Sources