Optimizing Lists and Rendering
Speed up large lists with tracking.
Why List Rendering Matters
Lists are the most common performance hotspot. Re-rendering an entire list on every change wastes work and resets DOM state. Angular gives you tools to render efficiently.
The @for Block
The built-in control-flow @for requires a track expression so Angular can identify each item across updates.
@for (item of items(); track item.id) {
<li>{{ item.name }}</li>
}All lessons in this course
- How Change Detection Works
- OnPush Change Detection
- Zoneless Angular
- Optimizing Lists and Rendering