Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

ngfor index

<ul>
  <li *ngFor="let food of menu; index as i">
      {{ index }},{{ food }}
  </li>
</ul>
<!-- index starts from 0 
This gives an undordered list of food items in a menu, with the first item as 0-->
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ngfor #index
ADD COMMENT
Topic
Name
9+8 =