platanus / angular-restmod

Rails inspired REST-API ORM for Angular
http://platanus.github.io/angular-restmod/
MIT License
1.18k stars 87 forks source link

[features] Better support for pagination and search query params in $location #242

Open facultymatt opened 9 years ago

facultymatt commented 9 years ago

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:

$scope.posts = Post.$fetch({page: 1});

The $location service would be used to auto append the url with

?page=1

If you also queried Post.$fetch({page: 1, owner: 99}) then the query string would update to

?page=1&owner=99

Read more here: https://github.com/brettshollenberger/the-abstractions-are-leaking/wiki/Query-Interface#maintaining-state

What are your thoughts on this feature?

iobaixas commented 9 years ago

I'll give it a thought, the Pagination mixin definitely needs a little attention!

facultymatt commented 9 years ago

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.

facultymatt commented 9 years ago

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.

iobaixas commented 9 years ago

Some comments:

I'm currently on vacations, it may take a little longer for me to answer your posts.

svenstaro commented 9 years ago

Any progress?