docs: clarify that @for doesn't support break/continue (#59533)

We recently saw some confusion around this, so it's worth adding a
sentence to clarify

PR Close #59533
This commit is contained in:
Jeremy Elbourn
2025-01-15 08:23:12 -08:00
committed by kirjs
parent 3e31438d59
commit c38ea0767e
2 changed files with 4 additions and 0 deletions
@@ -50,6 +50,8 @@ A typical `@for` loop looks like:
}
```
Angular's `@for` block does not support flow-modifying statements like JavaScript's `continue` or `break`.
### Why is `track` in `@for` blocks important?
The `track` expression allows Angular to maintain a relationship between your data and the DOM nodes on the page. This allows Angular to optimize performance by executing the minimum necessary DOM operations when the data changes.