Update to support custom initial page load#356
Update to support custom initial page load#356gotolino wants to merge 1 commit intomichaelbromley:masterfrom
Conversation
I needed to use URL query to know in which page the user was. I put an initial page tag to know which page the user would like to open.
|
I like it! :) please merge it!! |
|
Hi, thanks for the PR. Could your use case not be satisfied by using the |
|
Hi! That was my initial approach. I injected the pagination service in my controller to manually set the current page using the setCurrentPage(). But I needed the paginationId, which I did not know how to get. Ended up using the default value '__default' to solve the problem. Anyway, I thought using that approach was a little bit hacky, since I had to look through the code and hard-code the pagination id in my controller, and had to inject the paginationService just to set the current page this one time. So I took the liberty to change the directive so that the logic remained there, without the need of external influences. Well, I thought it could help someone, so I made this PR. It took me some time to discover how to do that. |
|
Hi guys, Sorry about the long delay. I still don't understand why you needed to get so hacky with the paginationService stuff. What about this: http://plnkr.co/edit/Cycne8sw1lRlMqpc0rRS?p=preview Here I am simple setting the |
I needed to use URL query to know in which page the user was. I put an initial page tag to know which page the user would like to open.
The tag would look like: