0 votes
in Angular by

What is the purpose of *ngFor directive?

1 Answer

0 votes
by

We use Angular *ngFor directive in the template to display each item in the list. For example, here we can iterate over a list of users:

<li *ngFor="let user of users">

  {{ user }}

</li>

The user variable in the *ngFor double-quoted instruction is a template input variable.

...