Feature request
There should be 2 buttons like << and >> to jump to the first and last page.
There is no button for this. There is only a button for < and > prev and next.
Items per page: 10 - 1 - 10 of 100 < >
If you have a long list, often it is needed to jump to the end and back to the first page/first items.
Items per page: 10 - 1 - 10 of 100 << < > >>
https://github.com/angular/material2/issues/7615 - as a reference.
Hi @andrewseguin I'd be keen to give this one a go
Sounds good to me, let's set the requirements and iterate from there:
Input())I agree with the above requirements.
For tests would it just be the spec tests? I don't see the paginator in the e2e tests.
Yup just some spec unit tests would suffice, try to consider the main case and edge cases, e.g. the jump-to-first button should be disabled when on the first page
Whilst doing the above I found two bugs in the spec file. Would it be best to do them as separate PRs or in the same PR that I'm currently working on, when I have completed this feature?
goToLastPage() method and in the following test 'should disable navigating to the next page if at last page'. See fix hereThe bug fix for 2 is required in order to write a valid test for the current feature.
Good catch - if you submit the fixes via separate PRs, that'd be a lot easier for us.
Thanks! And will do
Do I need to create issues for them or straight to the PRs?
No issue needed, just a PR will do
Will do.
On a side note: for the Component attribute of showing/hiding the first and last buttons would you have any recommendations on naming? I am thinking hideFirstLastButtons, which would be similar to the current hidePageSize?
e.g.
<mat-paginator [pageIndex]="pageIndex"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
[hidePageSize]="hidePageSize"
[hideFirstLastButtons]="hideFirstLastButtons"
[length]="length"
(page)="latestPageEvent = $event">
</mat-paginator>
Naming tends to be one of the harder parts of these sort of features.
By default, the paginator shouldn't show the first/last buttons anyways since the material spec doesn't include them. I imagine the flag would be more like showFirstAndLastButtons.
Curious how the interaction would look if you had a paginator for an "infinitely" long list. You'd want to make sure you can easily hide the Jump to Last button since it doesn't make sense.
Ok, I'll make the first/last buttons hidden by default and implement the showFirstAndLastButtons attribute.
Shall I add showFirstButton and showLastButton too to allow the control such as with the "infinitely" long list?
Since its a pretty uncommon case and I'd lean more towards keeping a thinner API surface, let's leave those off. In that case it should be fairly trivial to just add a display: none to the last button.
If it comes up from users in the future, we can always add it in then
Great point
Is there a best practice for doing multiple PRs for the same file to avoid the conflicts on merge?
I have added the first and last buttons to the demo app, in a new table, and to the material-examples, to the existing table, is this correct or would there be a better way to do this.
Additionally, would we need to submit a PR to the material.angular.io docs?
Here's where I'm currently at:
I'll have a look into the icons tomorrow but the functionality and all the tests are done 馃槃
I came across another bug, where the classes of the increment and decrement icons were wrongly named. I have implemented a fix in a separate PR #9597
I believe I have managed to implement the icons correctly with divs:

I will submit a PR for the feature now, let me know if there is anything you'd like changed.
Awesome looks great!
When we launch the material.angular.io site with these changes, the script we use will automatically pull in your docs and example
Thanks very much!
Not sure if you saw my previous message: "Is there a best practice for doing multiple PRs for the same file to avoid the conflicts on merge?"
The new PR will include the changes made in the previous 3 bug fixes
Ah right - go ahead and include the fixes in your PR and then write in the description that they include fixes from the other PRs and that the PR is blocked until the others are in. Since they are small I imagine they will be merged fairly quickly. Once they are in, you can rebase and remove the disclaimer on your final PR
Thanks Andrew, will do!
This is awesome. Great work @lharries!
@lharries I'm seeing this in Edge on first render:

Once you click on the button it corrects:

Any ideas?
@btroncone apologies for that. I'll set up an Edge development environment and get this fixed
@lharries No worries! Had QA catch it in one of my projects and wanted to make you aware. I messed around with it briefly but didn't reach a solution I was happy with, hopefully you will have better luck!
@btroncone I'll create an issue and see if we can get it fixed
@btroncone there's a fix already submitted #9776
@lharries Awesome, thanks for the update!
Hi how to install this package @lharries ? is it by the default npm install --save @angular/material?
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
This is awesome. Great work @lharries!