Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

pagination breaks after totalItems = 0 #376

Open
Spoilt opened this issue Mar 9, 2020 · 1 comment
Open

pagination breaks after totalItems = 0 #376

Spoilt opened this issue Mar 9, 2020 · 1 comment

Comments

@Spoilt
Copy link

Spoilt commented Mar 9, 2020

Expected Behavior

Show pages number instead of NaN when TotalItems passes through 0 (zero)

Current Behavior

totalItems

Steps to Reproduce (for bugs)

Stackblitz

Your Environment

  • Version used: 6.1.3 (Stackblitz: 6.0.0)
  • Angular version used: 7.2.13 (Sb: 6.0.3)
  • Browser Name and version: Chrome 80.0.3987.132 (64bits), Firefox 74.0b9 (64 bits)
  • Operating System and version (desktop or mobile): Windows 10
  • Link to your project (if appropriate): N/A
@Spoilt
Copy link
Author

Spoilt commented Mar 9, 2020

Ugly workaround from hell :

  • Copied MzPaginationModule, pasted it in my app.
  • Fixed some imports
  • renamed selectors to app-mz-pagination...
  • replaced in pagination.component.ts line 20 :
// before
return Math.ceil(this.totalItems / this.itemsPerPage);
// after
return Math.ceil((this.totalItems || 1) / this.itemsPerPage);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant