I have angular4 with materialize table Api so I am trying to get row data when user click on the row but its not passing data, How can i pass data to component from view any help will be appreciated ?
app.component.html
<div class="table-container">
<mat-table>
<ng-container matColumnDef="eventType">
<mat-header-cell *matHeaderCellDef> Event Type </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.eventType}} </mat-cell>
</ng-container>
<!--<button (click)="newMessage()" class="button">New Message</button>-->
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;" (click)="highlight(row._id,$event)"></mat-row>
</mat-table>
</div>
app.component.ts
highlight(id,event){
console.log('Event',event);
}