ngForOf in Angular 4

ngForOf is same as ngFor

But Difference is:-

ngFor = is not type safe
ngForOf = is type safe

How to Use ngFor

Now ngForOf

this will be work with ng-template or template tag only

–HTML

<ng-template ngFor let-user [ngForOf]="users">
<p>{{user.name}}</p>
</ng-template>

Leave a Reply

Your email address will not be published. Required fields are marked *