Asp.net core 2.1 Web Api + Angular6 分页 (ngx-bootstrap)
1.安装X.PagedListGitHub 地址:https://github.com/dncuug/X.PagedList.NET Core (.NET Standard 2.0)Install X.PagedList.Mvc.Core via NuGet - that will automatically install X.PagedList as well.方法应该是:dot...
·
1.安装X.PagedList
GitHub 地址:https://github.com/dncuug/X.PagedList
.NET Core (.NET Standard 2.0)
- Install X.PagedList.Mvc.Core via NuGet - that will automatically install X.PagedList as well.
方法应该是:dotnet add package X.PagedList.Mvc.Core --version 7.5.0
安装完之后,在你项目中引用
using X.PagedList;
ok,按照 GitHub那个就OK了, 一个 to paged list()就差不多了
前台的 angular那边就往后传第几页就行了,pageIndex
<pagination [totalItems]="totalElments" (pageChanged)="pageChanged($event)"></pagination>
getAllGarbages(pageIndex: number) {
this.garbageServices.getAllGarbages(pageIndex).subscribe((result: any) => {
this.garbageList = result.garbageViewModels;
this.noRecord = result.totalElements === 0;
this.totalElments = result.totalElements;
大概就这样啊。 嘿嘿
更多推荐
已为社区贡献3条内容
所有评论(0)