Skip to content

How to exclude certain array items from total item count on current page #468

@andypande

Description

@andypande

Thanks so much for putting this directive together Micheal - it is incredibly useful! I just have one small issue I needed your help with.

Description of issue:
Say I have a list of employee users:
[
{ name: "A", showUser: true}
{ name: "B", showUser: true}
{ name: "C", showUser: false}
]

Imagine this list is 100+ people with the same properties. Out of this list, I'd like the pagination directive to only consider users with showUser set to true when considering which users to show on every page. Basically, if out of the first 40 elements in the list, only 25 of them have showUser set to true, I would want the pagination directive to only display these users whenever show 25 options for pagination is selected. I cannot splice these users from the array as they are needed for other parts of my code.

Demo: http://plnkr.co/edit/ZBQHyxutyqAQpbCljIIo?p=preview
In the plunk above, I want to not include any of the sequences that have firstSequence: "true"

Hope I explained my issue well enough - thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions