Structural Directives in Angular — a practical guide to Angular structural directives with clear examples you can reuse in real projects.
Angular Tutorial Series (27/119). Prefer one article? Read the complete Angular tutorial.
Short description
Track @for items with a track expression for performance.
Control flow
@if (user) {
<p>{{ user.name }}</p>
} @else {
<p>Guest</p>
}
@for (item of items; track item.id) {
<li>{{ item.name }}</li>
}