Skip to content

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