update pagination on count 0 (#3228)

This commit is contained in:
Cilibiu Bogdan
2018-04-24 19:24:01 +03:00
committed by Eugenio Romano
parent 8f27cd1758
commit 95a2a54017
3 changed files with 31 additions and 0 deletions

View File

@@ -87,6 +87,11 @@ export class PaginationComponent implements OnInit, OnDestroy, PaginationCompone
ngOnInit() {
if (this.target) {
this.paginationSubscription = this.target.pagination.subscribe((pagination: PaginationModel) => {
if (pagination.count === 0 && !this.isFirstPage) {
this.goPrevious();
}
this.pagination = pagination;
this.cdr.detectChanges();
});