<mat-cell *matCellDef="let element; let i index">{{ element.patientName }}<input type="hidden" [(ngModel)]="index" value={{i}}/></mat-cell>
I created an index variable to access the value in the typescript file and attempted to console.log(index)
, but it returned undefined
.
export class DashboardComponent implements OnInit, OnDestroy {
index: number;
constructor(){}
console.log(index);
}