更新时间:2022-05-08 21:27:13
我忘记定义动作的标题单元格了.因此它引发了该错误.这是解决此问题的代码.
I forgot to define the header cell for the actions. So it was throwing that error. Here is the code which solved this problem.
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let row">
<button mat-button (click)="showDetails(row)">DETAILS</button>
<button mat-button (click)="editItem(row)">EDIT</button>
<button mat-button (click)="deleteItem(row)">DELETE</button>
</mat-cell>
</ng-container>