Open facultymatt opened 9 years ago
I'll give it a thought, the Pagination mixin definitely needs a little attention!
I have a great working mixin for this! I will post today...
On Mon, Feb 2, 2015 at 10:23 AM, Ignacio Baixas notifications@github.com wrote:
I'll give it a thought, the Pagination mixin definitely needs a little attention!
— Reply to this email directly or view it on GitHub https://github.com/platanus/angular-restmod/issues/242#issuecomment-72474921 .
Matt Miller
Web Master 609-335-4417 matt@superpedestrian.com https://www.superpedestrian.com/ https://www.google.com/url?q=https%3A%2F%2Fwww.superpedestrian.com%2F&sa=D&sntz=1&usg=AFQjCNHLEDFaMLgggeXL8rh4gGlNfN0WSA
Superpedestrian Inc. 84 Hamilton St. Cambridge, MA 02139
This message is intended only for the addressee named above. If you are not the intended recipient of this message, you are hereby notified that you must not use, disseminate, or copy it in any form or take any action in reliance upon it. If you have received this message in error, please delete it and any copies of it from your email system and reply immediately to the sender at the address shown above. This message may contain confidential and/or proprietary information. Neither confidentiality, nor any proprietary rights are intended to be waived or lost by any error in transmission.
See https://github.com/facultymatt/angular-restmod/compare/features/paginate-querystring?expand=1
First pass, still needs optimization, especially around mixing into multiple models and conflicts that might occur.
Some comments:
totalCount
a variable of the mixin function closure scope will mean that every collection of the same type will share the same totalCount
, maybe it should be stored in a collection property?bindToRoute()
maybe?).I'm currently on vacations, it may take a little longer for me to answer your posts.
Any progress?
This library https://github.com/brettshollenberger/the-abstractions-are-leaking/wiki/Pagination has a great feature where page and other query params are kept in sync with $location.
For example, in the following example:
The
$location
service would be used to auto append the url withIf you also queried
Post.$fetch({page: 1, owner: 99})
then the query string would update toRead more here: https://github.com/brettshollenberger/the-abstractions-are-leaking/wiki/Query-Interface#maintaining-state
What are your thoughts on this feature?