Skip to content

Caching state/view #2751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue May 17, 2016 · 4 comments
Closed

Caching state/view #2751

ghost opened this issue May 17, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented May 17, 2016

Typically for most web application, user is served with a listing page (whether it is a infinite scroll, a paginated list, or something in between with "show more" button), then a item detail page. It is really unfriendly and annoying to re-scroll/ re-browse the list.

Ionic can do it, since very very long time : http://ionicframework.com/docs/api/directive/ionNavView/

I know people have raised this issue before
#1800
#63

and I also know that ui team is very busy. So I played around with ui-router source code for a while but have no idea what to do.... I also browse ionic source code which is really complex. I think I need hints and suggestions to implement the features by myself

For the moment, we desperately need to cache the listing page

@christopherthielen
Copy link
Contributor

Have you looked into ui-router-extras "sticky states"?
http://christopherthielen.github.io/ui-router-extras/#/sticky

If you have one or two views that you don't want to rebuild, you can use sticky states to keep them around in the DOM. You show/hide as they're inactivated/reactivated.


As for your use case...

It is really unfriendly and annoying to re-scroll/ re-browse the list.

I think that could be solved by saving and restoring the scroll position as states are entered/exited. I don't know if this is something ui-router should have in core, however.

@ghost
Copy link
Author

ghost commented May 23, 2016

@christopherthielen : thank you for making it a feature.

BTW, I am trying sticky view one more time, and I got it. (I tried router-extra a year ago but failed to understand it). It actually make my code much cleaner, no more storing the listing in session.

Thanks, you guys are so awesome

@israelcrux
Copy link

+1

@stale
Copy link

stale bot commented Jun 11, 2021

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues
may be reopened.

Thank you for your contributions.

@stale stale bot added the stale label Jun 11, 2021
@stale stale bot closed this as completed Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants