Angular NgFor Example | NgFor Directive In Angular

By Hardik Savani October 20, 2023 Category : Angular

Hi All,

I am going to explain you example of angular ngfor example. you can understand a concept of how to use ngfor in angular 8. it's simple example of angular 9 ngfor tutorial. let’s discuss about angular ngfor directive example.

You can use ngFor directive in angular 6, angular 7, angular 8, angular 9, angular 10, angular 11, angular 12, angular 13, angular 14, angular 15, angular 16 and angular 17 application.

Angular provide set of pre define directive and in this tutorial i will give you simple example of *ngFor. ngFor allows us to build data presentation lists and tables in HTML template.

Let's see bellow example:


import { Component } from '@angular/core';


selector: 'my-app',

templateUrl: './app.component.html',

styleUrls: [ './app.component.css' ]


export class AppComponent {

students = [

{id: 1, name: 'Hardik', email: ''},

{id: 2, name: 'Vimal', email: ''},

{id: 3, name: 'Harshad', email: ''},




<h1>Angular ngFor Directive Example -</h1>







<tr *ngFor="let student of students">

<td>{{ }}</td>

<td>{{ }}</td>

<td>{{ }}</td>



You can see bellow layout:

I hope it can help you...

Tags :