Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Escaped "short" word and added ability to stop updatingRoute in beforeUpdateRoute #577

Closed
wants to merge 6 commits into from

Conversation

bartes
Copy link

@bartes bartes commented Oct 4, 2011

No description provided.

@vojtajina
Copy link
Contributor

Closing this PR. We are that we want api for canceling the route change, but it's not that simple (we need to revert the $location), so here is an issue for that: #592

@vojtajina vojtajina closed this Oct 13, 2011
@bartes
Copy link
Author

bartes commented Oct 14, 2011

Currently in our project we are reverting location url in more less this way

this.$on("$beforeRouteChange", function(scope, next, current, stopCallback) {
if (!current){
self.lastUrl = $location.url();
return;
}

if (next && userWantToGo()){
  self.lastUrl = null;
} else {
  stopCallback();
  $location.url(self.lastUrl);
}

});

It could be integrated inside $route service.

@vojtajina
Copy link
Contributor

yep, the problem is, when route change is induced by outside change (browser's url change) - e.g. user has typed into address bar or clicked on link (in hashbang $location mode)...

We have to consider these cases as well...

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

Successfully merging this pull request may close these issues.

None yet

3 participants