我是新来的角和尝试在我的应用程序中实现分页。我试图用这个组件如何从材质角度使用paginator?
https://material.angular.io/components/paginator/overview
与下面的代码,我可以得到长,页面大小,在我的.ts文件pageSizeoptions
的.html
<md-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
</md-paginator>
.TS
export class PaginatorConfigurableExample {
length = 100;
pageSize = 10;
pageSizeOptions = [5, 10, 25, 100];
}
}
但我似乎无法触发一个函数来改变da当页面更改时,上表中的ta是否在上表中?另外,如何使用nextPage,previousPage,hasNextPage,hasPreviousPage方法?
检查此[plunker](https://plnkr.co/edit/?p=preview)这可能会有所帮助。对于分页,你也可以使用这个库,我觉得它更简单[链接](从“ngx-pagination”;)导入{NgxPaginationModule};我已经使用它[这里](https://rahulrsingh09.github.io/AngularConcepts/ #/ comment) –
你确定你发布了正确的链接? – HeisenBerg
对不起,但仍然不是正确的plunker,我认为,它打开https://plnkr.co/edit/?p=preview – HeisenBerg