Search
 
SCRIPT & CODE EXAMPLE
 

HTML

index in ng for

You have to use let to declare the value rather than #.

<ul>
    <li *ngFor="let item of items; let i = index" [attr.data-index]="i">
        {{item}}
    </li>
</ul>
Angular = 1
<ul>
    <li *ngFor="#item of items; #i = index" [attr.data-index]="i">
        {{item}}
    </li>
</ul>
Comment

PREVIOUS NEXT
Code Example
Html :: dont show suggestions in input hs 
Html :: add fav icon to browser tab html 
Html :: html select default blank 
Html :: make websites all-deivce compatible 
Html :: img load error use other image 
Html :: routerlink forward ionic 
Html :: how to add the phtml using xml magento 2 
Html :: View HTML5 Video on iOS devices without going to full screen 
Html :: how to change background image in html 
Html :: bootsrap label 
Html :: basecamp 3 api tag mention 
Html :: django template tags background-image 
Html :: dropdown bootstrap 5 
Html :: how to get value of textbox in javascript from html 
Html :: ion-searchbar change event 
Html :: thead position sticky 
Html :: dropdown menu html 
Html :: html telephone 
Html :: pass method to composite jsf component 
Html :: meta tag viewport 
Html :: 9+15 
Html :: what is html 5 
Html :: prevent the child event from triggering the parent element angular 5 
Html :: ionic button trigger ion-datetime 
Html :: tailwind hover color 
Html :: how to stop text in html from becoming a link 
Html :: how to change text color of anchor tag in html 
Html :: html fieldset color background 
Html :: how to color div html 
Html :: display object with indentaion in html 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =