-
Notifications
You must be signed in to change notification settings - Fork 27.5k
$route should allow canceling the navigation #592
Comments
Definitely agree with adding something like a $beforeRouteChange or $beforeRouteChangeStart event. $locationChangeStart works (although hitting the back button only works with the fix to $location mentioned here: #2109), it seems much more intuitive for $route to handle notifying before a route changes and allowing it to be cancelled since we already have $routeChangeStart and $routeChangeSuccess. |
This commit adds support for Commit : sylvain-hamel@f8ac46e Any comment? |
As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months. Please try the newest versions of Angular ( Thanks! |
Using latest angular $routeChangeStart event parameter has preventDefault() method which apparently does absolutely nothing. It also peculiarly has a property: defaultPrevented which is always false and if set to true also does absolutely nothing. Not sure why this was closed since it doesn't appear to be implemented or perhaps something else broke it (no regression tests?). |
reopening since this was never resolved, but a solution is provided by #4192 |
@Nerretz: I think f4ff11b closes this issue, right ? |
@gkalpak yup, you are right. Thnx! |
we need api for allowing that during $beforeRouteChange event.
With new $location is easy, as we can revert $location and then it will never be propagated into browser.
The difficult part is, if we want to allow canceling route change which was triggered by browser (user has typed different url).
The same propblem is when using hashbang mode, then clicking any link means updating the browser's address bar first...
The text was updated successfully, but these errors were encountered: