私は、マテリアライズテーブルApiとangular4を持っているので、ユーザーが行をクリックしてデータを渡さないときに行データを取得しようとしています。どのようにデータをコンポーネントに渡すことができますか?角度材料を使用して行データを取得する方法は?
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);
}
明らかに私のために働いているようです。[stackbiltz](https://stackblitz.com/edit/angular-nuvm31?file=app/table-filtering-example.html)ここをクリック –