How to Display Data in Angular 10?

September 4, 2020 | Category : Angular

In this tutorial, you will learn how to show data in angular 10. if you want to see example of how to display data using ng for in angular 10 then you are a right place. Here you will learn angular 10 ngfor display data example. i would like to show you angular 10 display json data in table.

Sometime we need to display our data in table format for front end. we will use ngfor directive for display data in table. we will also use bootstrap for displaying data in angular application.

Let's see simple following step to done simple example that will help you to displaying data in angular app.

Create New App

If you are doing example from scratch then You can easily create your angular app using bellow command:

ng new my-app

updated Ts File

In this file we will create students object array using Student interface. so let's see bellow file code.


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

interface Student {

id: Number;

name: String;

email: String;

gender: String;



selector: 'my-app',

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

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


export class AppComponent {

name = 'Angular';

students: Student[] = [


id: 1,

name: "Hardik",

email: "",

gender: "male"



id: 2,

name: "Paresh",

email: "",

gender: "male"



id: 3,

name: "Kiran",

email: "",

gender: "female"



id: 4,

name: "Mahesh",

email: "",

gender: "male"



id: 5,

name: "Karan",

email: "",

gender: "male"




Template Code:

In this step, we will write code for display data of stuidents object array variable using ngfor directive.

I used bootstrap class on this form. if you want to add than then follow this link too: Install Boorstrap 4 to Angular 10.


<div class="container">

<h1>How to Display Data in Angular 10? -</h1>

<table class="table table-striped">










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

<td>{{ }}</td>

<td>{{ }}</td>

<td>{{ }}</td>

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





Now you can run your application using following command:

ng serve

You can see bellow layout for demo. let's follow bellow step.


I hope it can help you...