Angular · Junior · Question 19 of 75
What is required in an @for block?
@for (item of items; track item.id) {
<li>{{ item.name }}</li>
}- ✓Correct answer: A
trackexpression that identifies each item - 2An
indexvariable declared explicitly - 3A
keyattribute on the<li>element
Explanation
track tells Angular how to match items between renders so it can reuse DOM nodes instead of recreating them. Use a stable id; track $index is acceptable only for static lists.