The ngFor statement is used to setup a loop to step through a collection of objects on an html page.
Here is an example.
note-type-list.component.html
here is a part of an html file. It’s a Grid List control provided by Material
1 | <mat-grid-list cols="4" rowHeight="170px" gutterSize="5px"> |
Notice the following
1 | <mat-grid-tile *ngFor="let noteType of noteTypes"> |
*ngFor starts a loop. The loop will step through each object contained in the noteTypes collection.
For each item in the loop, the mat-grid-tile tags, and the contents of <mat-grid-tile>..</mat-grid-tile> will be rendered.