<mat-cell *matCellDef="let element; let i index">{{ element.patientName }}<input type="hidden" [(ngModel)]="index" value={{i}}/></mat-cell>
I made an index variable to use the value in the type script and tried console.log(index) and found undefined.
export class DashboardComponent implements OnInit, OnDestroy {
index: number;
constructor(){}
console.log(index);
}