michaelbromley / michaelbromley/angularUtils
When switching data sources dir-pagination-controls displays wrong number of results
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 842
- PR merge metrics
- No merged PRs in 30d
Description
The code below displays 37 pages when `vm.totalResults` is zero. The issue only happens in one scenario:
1. Display a user with 37 results
2. Hide that user data with `ng-if` go to another user with 0 results
3. User displays 37 results.
4. Refresh the page (F5 in browser) and now the pagination control goes away as it should as there are 0 results.
Why is this happening?
``` html
//More code...
```
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 reproducing the four-step data-source switch using the dir-paginate and dir-pagination-controls markup shown, with vm.totalResults changing from 37 to 0 through ng-if. Trace the pagination control's state across the switch and compare it with a full page refresh. Done means the control no longer displays stale pages when vm.totalResults is zero.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angularjs
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100