Skip to content

Commit

Permalink
fix(module:pagination): fix nzPageIndexChange event does not emit (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
SangKa authored and vthinkxie committed Aug 31, 2017
1 parent c9e8c98 commit 371b98a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/pagination/nz-pagination.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
<a></a>
</li>
<li [attr.title]="_current+'/'+_lastIndex" class="ant-pagination-simple-pager">
<input [(ngModel)]="nzPageIndex" size="3"><span class="ant-pagination-slash">/</span>{{_lastIndex}}
<input [ngModel]="nzPageIndex" (ngModelChange)="_nzPageIndexChange($event)" size="3"><span class="ant-pagination-slash">/</span>{{_lastIndex}}
</li>
<li
title="下一页"
Expand Down Expand Up @@ -103,7 +103,7 @@ import {
</nz-select>
<div class="ant-pagination-options-quick-jumper"
*ngIf="nzShowQuickJumper">
跳至<input [(ngModel)]="nzPageIndex">页
跳至<input [ngModel]="nzPageIndex" (ngModelChange)="_nzPageIndexChange($event)">页
</div>
</div>
</ul>`,
Expand Down Expand Up @@ -244,6 +244,11 @@ export class NzPaginationComponent {
this.nzPageSizeChange.emit($event);
}

_nzPageIndexChange($event) {
this.nzPageIndex = $event;
this.nzPageIndexChange.emit(this.nzPageIndex);
}

/** generate indexes list */
_buildIndexes() {
this._lastIndex = Math.ceil(this._total / this._pageSize);
Expand Down

0 comments on commit 371b98a

Please sign in to comment.