michaelbromley / michaelbromley/angularUtils
optional '...' and last/first page button
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 842
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to have the option do disable the first and last page buttons and to then also remove the '...' "pages"
so instead of [<<][<][1][...][4][(5)][6][...][10][>][>>]
I would get [<<][<][2][3][4][(5)][6][7][8][>][>>]
if I had max-size set to 7 (and 5th page selected)
in any case, when having the boundary buttons the [first page][...] .... [...][last page] buttons are unnecessary, the only thing they bring to the table is a display of the max number of pages.
Sure I can rewrite the template to the following to get what I want, but it's not pretty:
```
-
«
-
-
{{pagination.last-maxSize/2+1>pagination.current?pagination.current-3:pagination.last+1-maxSize}}
-
{{pagination.last-maxSize/2+1>pagination.current?pagination.current-2:pagination.last+2-maxSize}}
-
{{ pageNumber }}
-
{{pagination.current>maxSize/2+1?pagination.current+2:maxSize-1}}
-
{{pagination.current>maxSize/2+1?pagination.current+3:maxSize}}
-
-
»
```
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 with the pagination template shown in the issue and the code that builds its pages list; compare boundaryLinks, directionLinks, maxSize, and the requested output. Done means optional first and last controls and omission of the ellipsis are supported without a template rewrite, including the max-size 7 example with page 5 selected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angularjs, javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100