Skip to content
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

Update webStorage on route change, rather then manual intervention #197

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sime
Copy link

@sime sime commented Dec 23, 2015

Currently if a storage modification is done followed by a route change, it is possible that the changes haven't been committed and thus not available. This PR is the Angular equivalent to the beforeunload listener.

Rather than making the user manually specify a $timeout() prior to a route change, I think it is of greater convenience to execute $storage.$apply() on $routeChangeStart/$stateChangeStart.

If this may be a undesirable default behaviour, a configuration option can easily be set up.

@schmuli
Copy link

schmuli commented Oct 27, 2016

Wouldn't it be more correct to just listen to the $locationChangeStart event, from the Location service?

@sime
Copy link
Author

sime commented Oct 27, 2016

@schmuli I can't recall my reasoning, but I feel I recall waiting for $locationChangeStart to fire in ui-router and it never happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants