I have the following Material Table
Code for "Action" is as given below:
<ng-container matColumnDef="Action">
<th mat-header-cell *matHeaderCellDef> Action</th>
<td mat-cell *matCellDef="let element">
<i class="material-icons mat-icon-button" (click)="greeting(element)">open_in_new</i> </td>
</ng-container>
Every row of this table has an associated Special_Id in the database which I am getting, through a GET REST call, along with all this data but not showing in the UI and hence that's not a part of the column of this material table.
Code for the interface is as follows:
export interface PeriodicElement {
special_id:string;
name: string;
position: number;
weight: number;
symbol: string;
}
code for the column of Material table:
displayedColumns: string[] = ['position', 'name', 'weight', 'symbol','Action'];
On click of the Action Button corresponding to every row, a method greeting(element) is called. My challenge is to pass the Special_Id as parameter to method 'greeting'. How can I achieve that? AngularJS is quite new to me and I am not able to figure out how to do that.