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

pagination breaks after totalItems = 0 #376

Open

Description

@Spoilt

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

Activity

  1. Spoilt commented on Mar 9, 2020

    @Spoilt
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions