Let's see how to track index when we use 'ngFor:

 

            <li *ngFor="#hero of heros | async; let i = index">
               <hero-item [hero]="hero" (changed)="thisHero = $event;" [index]="i"></hero-item>
            </li>

 

let i = index, simple as that :)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2021-04-07
相关资源
相似解决方案