From eec52c1ac341c8c848a317e02e66bcb6ccf7e343 Mon Sep 17 00:00:00 2001 From: Krzysztof Date: Fri, 5 Feb 2016 19:20:38 +0100 Subject: [PATCH] Update pagination.component.ts --- components/pagination/pagination.component.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/components/pagination/pagination.component.ts b/components/pagination/pagination.component.ts index 63502e3515..2ae9177118 100644 --- a/components/pagination/pagination.component.ts +++ b/components/pagination/pagination.component.ts @@ -135,12 +135,15 @@ export class Pagination implements ControlValueAccessor, OnInit, IPaginationConf } public set page(value) { + var _previous = this._page; this._page = (value > this.totalPages) ? this.totalPages : (value || 1); + if (_previous !== this._page && typeof _previous !== 'undefined') { + this.pageChanged.emit({ + page: this._page, + itemsPerPage: this.itemsPerPage + }); + } - this.pageChanged.emit({ - page: this._page, - itemsPerPage: this.itemsPerPage - }); } public get page() {