Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions skills/dev-skills/angular-developer/references/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ The `@for` block iterates over collections. The `track` expression is **required

**Implicit Variables**: `$index`, `$count`, `$first`, `$last`, `$even`, `$odd`.

**Avoid calling non-memoized methods in template expressions** (e.g. `@for (x of getItems())`, `{{ formatDate(item.date) }}`). These reevaluate on every change-detection run, which is wasteful when the computation is nontrivial. Prefer a `computed()` signal, or a pure pipe, so the result is cached and only recalculated when its dependencies change. A plain function call is fine when it's a trivial/pure lookup (e.g. reading a signal, indexing an object).

### Switching Content (`@switch`)

The `@switch` block renders content based on a value. It uses strict equality (`===`) and has **no fallthrough**.
Expand Down