- ngFor in Angular | ngfor in Angular | How to use for in Angular | ngfor in angular 9


 


App.component.html

<h1>Welcome to {{title}}</h1>

<h2>ngFor Tutorial</h2>

<div *ngFor="let item of list;let i=index">

  {{i+1}}.{{item.value}}

</div>

 

 App.component.ts

export class AppComponent {

     title='Shubho Tech'

     list:any[]=[

       {

         'value':10

       },

       {

         'value':20

       },

       {

         'value':30

       },

       {

         'value':40

       },

       {

         'value':50

       }

     ]   

}


Post a Comment

Previous Post Next Post