pagination - Page-change event not working in ng2-bootstrap -
i trying implement pagination in angular2 app ng2-bootrap. 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} 'angular2/core'; import { core_directives } 'angular2/common'; import { pagination_components } '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 change pagination page not triggering pagechanged event. please correct me work properly.
the output called pagechanged, not page-changed
Comments
Post a Comment