Angular NgFor Example | NgFor Directive In Angular 9/8

Angular NgFor Example | NgFor Directive In Angular 9/8

In this post we will give you information about Angular NgFor Example | NgFor Directive In Angular 9/8. Hear we will give you detail about Angular NgFor Example | NgFor Directive In Angular 9/8And how to use it also give you demo for it if it is necessary.

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 and angular 9 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:

src/app/app.component.ts

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

@Component({

selector: 'my-app',

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

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

})

export class AppComponent {

students = [

{id: 1, name: 'Hardik', email: 'hardik@gmail.com'},

{id: 2, name: 'Vimal', email: 'vimal@gmail.com'},

{id: 3, name: 'Harshad', email: 'harshad@gmail.com'},

]

}

src/app/app.component.html

Also see:Angular NgForm Example | NgForm Directive In Angular 9/8

<h1>Angular ngFor Directive Example - ItSolutionstuff.com</h1>

<table>

<tr>

<th>ID</th>

<th>Name</th>

<th>Email</th>

</tr>

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

<td>{{ student.id }}</td>

<td>{{ student.name }}</td>

<td>{{ student.email }}</td>

</tr>

</table>

You can see bellow layout:

I hope it can help you…

Hope this code and post will helped you for implement Angular NgFor Example | NgFor Directive In Angular 9/8. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

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

82  +    =  89

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US