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

Update route.js #5855

Closed
wants to merge 1 commit into from
Closed

Update route.js #5855

wants to merge 1 commit into from

Conversation

yentheo
Copy link

@yentheo yentheo commented Jan 17, 2014

feat(ngRoute): change

This change adds a new event on ngRoute called beforeRouteChange. With this change it is possible to cancel a locationChange based on route data. The problem that I am trying to fix here is described in #5581

feat(ngRoute): change

This change adds a new event on ngRoute called beforeRouteChange. With this change it is possible to cancel a locationChange based on route data. The problem that I am trying to fix here is described in #5581
@mary-poppins
Copy link

I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let us know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@caitp
Copy link
Contributor

caitp commented Jan 17, 2014

I have a working implementation of this in #5714 --- If you're interested in this behaviour, you could implement a similar strategy and we could merge your version instead.

I think there are still a couple of minor issues with it, so it could be some time before it gets the proper review treatment

@IgorMinar
Copy link
Contributor

no cla + the solution is not right because it relies on brittle combination of info from two events.

@IgorMinar IgorMinar closed this Oct 2, 2014
caitp added a commit to caitp/angular.js that referenced this pull request Oct 3, 2014
Previously, one could perform this feat by listening to both
$locationChangeStart as well as $routeChangeStart, and being careful to update
the route correctly. Now, it's possible to simply preventDefault() on the
$beforeRouteChange event in order to prevent location and route from being
updated.

While this does not cancel $routeChangeStart, it does ensure that the correct
location is restored, and provides the same information as $routeChangeStart.

Closes angular#5855
Closes angular#5714
Closes angular#5581
caitp added a commit to caitp/angular.js that referenced this pull request Oct 3, 2014
Previously, one could perform this feat by listening to both
$locationChangeStart as well as $routeChangeStart, and being careful to update
the route correctly. Now, it's possible to simply preventDefault() on the
$beforeRouteChange event in order to prevent location and route from being
updated.

While this does not cancel $routeChangeStart, it does ensure that the correct
location is restored, and provides the same information as $routeChangeStart.

Closes angular#5855
Closes angular#5714
Closes angular#5581
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants