I am trying to implement the pagination in my angular2 app with the ng2-bootrap. am following http://valor-software.github.io/ng2-bootstrap/#pagination
my app.html
<div>
<div class="col-lg-12 text-right">
<pagination [totalItems]="bigTotalItems" (page-changed)="pageChanged($event)" [(ngModel)]="bigCurrentPage" [maxSize]="maxSize"
class="pagination-sm" [boundaryLinks]="true"></pagination>
</div>
</div>
my component
import { Component, View, Inject} from 'angular2/core';
import { CORE_DIRECTIVES } from 'angular2/common';
import { PAGINATION_COMPONENTS } from 'ng2-bootstrap/ng2-bootstrap';
// webpack html imports
@View({
templateUrl: '/scripts/src/components/demo/demo.html',
directives: [PAGINATION_COMPONENTS, CORE_DIRECTIVES]
})
@Component({
selector: 'tabs-demo',
})
export class DemoComponent {
private totalItems: number = 64;
private currentPage: number = 4;
private maxSize: number = 5;
private bigTotalItems: number = 175;
private bigCurrentPage: number = 1;
private setPage(pageNo: number): void {
this.currentPage = pageNo;
};
private pageChanged(event: any): void {
console.log('Page changed to: ' + event.page);
console.log('Number items per page: ' + event.itemsPerPage);
};
}
but when i change the pagination page its not triggering the pagechanged event. Please correct me to work it properly.
The Output is called pageChanged, not page-changed