Coding task · Angular course · Module 2: Components

Practice: Control Flow @if and @for

The new Control Flow syntax in Angular 17+: @if (condition) { } @else { } and @for (item of items; track item.id) { }. Track is mandatory - it lets Angular update the list efficiently.

Task

Complete the template using @if for conditional display and @for to iterate over the warriors.