Skip to content

Commit

Permalink
fix(module:pagination): fix still show when total is 0 and nzHideOnSi…
Browse files Browse the repository at this point in the history
…nglePage is true (#1583)
  • Loading branch information
cipchk authored and vthinkxie committed Jun 2, 2018
1 parent 3bc2e90 commit c5c33d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/pagination/nz-pagination.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a class="ant-pagination-item-link" *ngIf="type!='page'"></a>
<a *ngIf="type=='page'">{{page}}</a>
</ng-template>
<ng-container *ngIf="(nzHideOnSinglePage&&(lastIndex!=1))||!nzHideOnSinglePage">
<ng-container *ngIf="(nzHideOnSinglePage&&(nzTotal>nzPageSize))||!nzHideOnSinglePage">
<ul
*ngIf="nzSimple"
[class.ant-table-pagination]="nzInTable"
Expand Down
6 changes: 6 additions & 0 deletions components/pagination/nz-pagination.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ describe('pagination', () => {
expect(testComponent.pageIndex).toBe(5);
});
});
it('should be hidden pagination when total is 0 and nzHideOnSinglePage is true', () => {
(testComponent as NzTestPaginationComponent).total = 0;
(testComponent as NzTestPaginationComponent).hideOnSinglePage = true;
fixture.detectChanges();
expect(fixture.debugElement.nativeElement.querySelector('.ant-pagination')).toBeNull();
});
});
describe('pagination render items', () => {
let fixture;
Expand Down

0 comments on commit c5c33d0

Please sign in to comment.