From 90f0333761ea38af6062dd956eae787beba1dc9d Mon Sep 17 00:00:00 2001 From: Alche Date: Sat, 30 Sep 2017 10:02:30 +0800 Subject: [PATCH] fix(module:table): fix nzIsPageIndexReset for wrong display (#372) (#373) close #372 --- src/components/table/nz-table.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/table/nz-table.component.ts b/src/components/table/nz-table.component.ts index e5fdf95d244..f3caea3d503 100644 --- a/src/components/table/nz-table.component.ts +++ b/src/components/table/nz-table.component.ts @@ -206,7 +206,7 @@ export class NzTableComponent implements AfterViewInit, OnInit { this.nzPageIndex = 1; } else { const maxPageIndex = Math.ceil(this._dataSet.length / this.nzPageSize); - this.nzPageIndex = this.nzPageIndex > maxPageIndex ? maxPageIndex : this.nzPageIndex; + this.nzPageIndex = !this.nzPageIndex ? 1 : (this.nzPageIndex > maxPageIndex ? maxPageIndex : this.nzPageIndex); } } this.data = this._dataSet.slice((this.nzPageIndex - 1) * this.nzPageSize, this.nzPageIndex * this.nzPageSize);