同时分页和按列过滤Angular 6

Pagination and filter by column at the same time Angular 6

如何修改这段代码以同时获得分页和过滤?问题是,如果我的 table 中有 1000 行,并且每页显示 50 行,则 name 的过滤器将仅应用于显示的 50 个条目。

<tr *ngFor="let user of usersList | paginate: { itemsPerPage: 50, currentPage: p } | filter: 'name' : searchString">
    <td>{{ user.name }}</td>
    <td>{{ user.email }}</td>
    <td>{{ user.office }}</td>
</tr>
<pagination-controls (pageChange)="p=$event" previousLabel="Previous" nextLabel="Next"></pagination-controls>

感谢您的宝贵时间!

这样修改即可:

<tr *ngFor="let user of usersList | filter: 'name' : searchString | paginate: { itemsPerPage: 50, currentPage: p }; let i=index">