michaelbromley / michaelbromley/angularUtils
Pagination: Multiple instances with asynchronous data
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 842
- PR merge metrics
- No merged PRs in 30d
Description
I've got the pagination library to work with my site. So far it's working great, thanks for the library.
But I have a question regarding multiple instances and asynchronous data on the same page. For the asynchronous data to work, you define the callback for on-page-change. This callback only passes the page number. When I have multiple instances on the page, how am I suppose to know which one pagination is being used?
I could do it where I define a unique function for each pagination, but that's ugly, especially with a very dynamic page.
The best way I can think of doing this is if the on-page-change callback passed the newPageNumber as well as the paginationId. Then I can identify which control is being used. Would that change be possible? Is there a better way of doing it?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the pagination component or directive and the on-page-change callback implementation. Review how multiple pagination instances are distinguished during asynchronous updates, then check existing tests or examples for callback behavior. Done means the intended instance can be identified without requiring a separate callback for each control.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100