I have a data grid which is getting used across the application. I am getting currently selected rowid using the below code.
In HTML:
<tbody>
<tr *ngFor="let ddata of tableData.data; let i = ddata" (click)="setClickedRow(ddata)" [class.active]="ddata.discountauthorizationid == selectedRow">
<td *ngFor="let dr of tableData.record | paginate: { itemsPerPage: pageItem, currentPage: p }">{{ddata[dr]}}</td>
</tr>
</tbody>
And in component.ts file I am doing this:
this.selectedRow = ddata.discountauthorizationid;
console.log("You selected!",ddata.discountauthorizationid);
this.dataService.changeMessage(ddata.discountauthorizationid);
Now I want to make this access completely dynamic and I have the primary id defined like this
@Input() primaryid: string
I want to access this data.(some_primaryid) just like we access the array using key and assign key using variable. Is it possible? If so how?