我将使用Angular材质库构建动态表。
<table dir="rtl" mat-table [dataSource]="dataSource" class="mat-elevation-z8" multiTemplateDataRows>
<ng-container *ngFor='let column of originalthis.displayColumns'>
<ng-container [matColumnDef]="column.key">
<th mat-header-cell *matHeaderCellDef> {{column.value}}</th>
*****<td mat-cell *matCellDef="let data"> {{ data.{{column.key}} }}</td>*****
</ng-container>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr (click)="chooseRow(row)" class="example-element-row" mat-row *matRowDef="let row; columns: displayedColumns;">
</tr>
</table>
我如何将数据连接到matCellDef {{数据。{{column.key}}}}似乎无效。