Permalink
Browse files

Step 13.8: Register configuration of pagination

  • Loading branch information...
1 parent 8740984 commit 97279f232ab441211b155d715f9f1619addaa487 @kamilkisiela kamilkisiela committed with DAB0mB Sep 23, 2016
Showing with 12 additions and 0 deletions.
  1. +12 −0 client/imports/app/parties/parties-list.component.ts
@@ -3,6 +3,7 @@ import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { Subscription } from 'rxjs/Subscription';
import { MeteorObservable } from 'meteor-rxjs';
+import { PaginationService } from 'ng2-pagination';
import 'rxjs/add/operator/combineLatest';
@@ -32,6 +33,10 @@ export class PartiesListComponent implements OnInit, OnDestroy {
nameOrder: Subject<number> = new Subject<number>();
optionsSub: Subscription;
+ constructor(
+ private paginationService: PaginationService
+ ) {}
+
ngOnInit() {
this.optionsSub = Observable.combineLatest(
this.pageSize,
@@ -57,6 +62,13 @@ export class PartiesListComponent implements OnInit, OnDestroy {
});
});
+ this.paginationService.register({
+ id: this.paginationService.defaultId,
+ itemsPerPage: 10,
+ currentPage: 1,
+ totalItems: 30,
+ });
+
this.pageSize.next(10);
this.curPage.next(1);
this.nameOrder.next(1);

0 comments on commit 97279f2

Please sign in to comment.