Rendering & reactivity

Templates

Reorder a list, inspect the keyed DOM elements, and watch what changes when the enclosing template disappears.

Angular 22.3.2 · trace
Lesson flow Fixture. Bound data. Control flow. List DOM.
Fixture
Bound data
Control flow
List DOM

Objective

Distinguish updating a live template from removing and recreating its view.

Transcript

Angular 22.3.2

  1. The list starts with two items. A pipe uppercases the bound names and each row has a stable key.
  2. Reversing the array changes the DOM order. The fixture compares the pear element before and after reordering.
  3. A mode change selects a different switch branch. Clearing the array renders the empty branch.
  4. Turning the enclosing @if off removes the restored list. Turning it back on creates new elements.
  5. The deferred scenario starts with a placeholder. Flipping the trigger on loads the detail component. Flipping it off leaves the details visible.

Sources