Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

654
Views
Cómo obtener el índice de fila en la tabla de materiales Angular

Cómo obtener el índice de fila en la tabla de materiales angular

 <td mat-cell *matCellDef="let row"> <mat-checkbox (click)="$event.stopPropagation()" (change)="$event ? selection.toggle(row) : null;isSomeSelected()" [checked]="selection.isSelected(row)"> </mat-checkbox></td>
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Puede declarar un índice como este let i = index :

 <td mat-cell *matCellDef="let row;let i = index"> <mat-checkbox (click)="$event.stopPropagation()" (change)="$event ? selection.toggle(row) : null;isSomeSelected()" [checked]="selection.isSelected(row)"> </mat-checkbox></td>
over 4 years ago · Santiago Trujillo Report

0

En su .ts defina el index como una propiedad de RowModel .

Luego puede acceder a él con row.index en la plantilla y el controlador.

.ts :

 const ELEMENT_DATA: PeriodicElement[] = [ {position: 1, name: 'item1', index: 0}, {position: 2, name: 'item2', index: 1}, {position: 3, name: 'item3', index: 2}, ];

.html :

 <td mat-cell *matCellDef="let row"> <mat-checkbox (click)="$event.stopPropagation()" (change)="$event ? selection.toggle(row) : null;isSomeSelected()" [checked]="selection.isSelected(row)"> </mat-checkbox> <span>{{row.index}}</span> </td>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!