Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant