Angular TutorialLesson 21Free preview
Angular Lists
This lesson is part of Angular · All levels
Summary
Displaying a data set such as an array is usually done with @for or directives *ngFor. Angular repeats the template elements for each item and provides context such as index, first, last, and even. For a longer list, add the track option to optimize the update performance.
Key points
- @for repeating items from array or collection
- ngFor is the structural directory equivalent of @for
- Context provides index, first, last, and even
- The track option helps Angular recognize the changed items
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.