我通过使用HTTP服务在一个表上使用mat-paginator,此处无法将分页器的长度设置为HTTP服务的结果总数,即[length] =“ 100”,但不是工作
html
<table mat-table [dataSource]="dataSource" matSort class="mat-table mat-elevation-z8">
<!-- Position Column -->
<ng-container matColumnDef="applicant_name">
<th mat-header-cell *matHeaderCellDef> Name </th>
<td mat-cell *matCellDef="let element"> {{element.applicant_name}} </td>
</ng-container>
<!-- Name Column -->
<ng-container matColumnDef="email_id">
<th mat-header-cell *matHeaderCellDef> Email </th>
<td mat-cell *matCellDef="let element"> {{element.email_id}} </td>
</ng-container>
<ng-container matColumnDef="job_title">
<th mat-header-cell *matHeaderCellDef> Job Title </th>
<td mat-cell *matCellDef="let element"> {{element.job_title}} </td>
</ng-container>
<ng-container matColumnDef="md5_onb">
<th mat-header-cell *matHeaderCellDef> Applicant Portal </th>
<td mat-cell *matCellDef="let element"> <a [routerLink] = "['/signin/',element.md5_onb]" >Applicant Login {{totalLength}} </a> </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator #paginator class="mat-elevation-z8" [length]="totalLength" [pageSize]="matTableRecords" [pageSizeOptions]="[5, 10, 20]" showFirstLastButtons (page)="pageChanged($event)"></mat-paginator>