Skip to content

Commit

Permalink
Step 13.8: Register configuration of pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela authored and DAB0mB committed Dec 14, 2016
1 parent 8740984 commit 97279f2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/imports/app/parties/parties-list.component.ts
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
Expand All @@ -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);
Expand Down

1 comment on commit 97279f2

@thoni56
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PaginationService's defaultId is now a function, so change them to defaultId().

Please sign in to comment.