目前正在使用角度材料设计垫表。请帮我从 mat-table 中删除数据记录。
这是代码:
<mat-table #table [dataSource]="dataSource" matSort slimScroll width="auto" height="450px" color="rgba(0,0,0,0.3)" size="3px">
<!-- modelName Column -->
<ng-container matColumnDef="modelname">
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
<mat-cell *matCellDef="let element" data-toggle="modal" data-target="#deviceView"> <span>{{element.modelname}}</span> </mat-cell>
</ng-container>
<!-- modelNumber Column -->
<ng-container matColumnDef="modelnumber">
<mat-header-cell *matHeaderCellDef mat-sort-header> Number </mat-header-cell>
<mat-cell *matCellDef="let element" data-toggle="modal" data-target="#deviceView"> <span>{{element.modelnumber}}</span> </mat-cell>
</ng-container>
<!-- manufacturer Column -->
<ng-container matColumnDef="manufacturer">
<mat-header-cell *matHeaderCellDef mat-sort-header> Manufac </mat-header-cell>
<mat-cell *matCellDef="let element" data-toggle="modal" data-target="#deviceView"> <span>{{element.manufacturer}}</span> </mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns; let i = index;" id="{{row.uuid}}" (click)="displayData(row.uuid); deleterow(index)"></mat-row>
</mat-table>
<div class="table-page">
<mat-paginator [length]="length" [pageSize]="1000" (page)="pageEvent = $event; onPaginateChange($event)">
</mat-paginator>
<div *ngIf="!pageEvent" class="pageformat text-primary">
{{pageSize}} / {{length}}
</div>
<div *ngIf="pageEvent" class="pageformat text-primary">
<div *ngIf="pageEvent.length >= pageEvent.pageSize * pageEvent.pageIndex + pageEvent.pageSize">{{pageEvent.pageSize * pageEvent.pageIndex + pageEvent.pageSize}} / {{pageEvent.length}}</div>
<div *ngIf="pageEvent.length <= pageEvent.pageSize * pageEvent.pageIndex + pageEvent.pageSize">{{pageEvent.length}} / {{pageEvent.length}}</div>
</div>
</div>
</div>
请检查并让我知道任何建议。