You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
I didn't have this issue with 1.2.26. Extract of my code:
app.run(['$rootScope','$location','config',function($rootScope,$location,config){$rootScope.$on('$routeChangeStart',function(event,next,current){// Maintenance modeif(config.project.maintenance===true){event.preventDefault();// The redirect must be inside this method since angular 1.3.0$rootScope.$evalAsync(function(){$location.path('/maintenance');});}});});
The /maintenance route has an empty controller. This code is causing an infinite loop, but not with 1.2.26. Got this error.
I understand why there is an infinite loop as I don't test the current route before redirecting. Why it worked before?
Is it a bug or something that I skipped from the changelog?
Bests
The text was updated successfully, but these errors were encountered:
For me it sounds very much similar to #9607 that also talks about redirects during route change change start event. We've got a fix for it in #9678 where preventDefault call will be no longer needed but it won't fix the situation where we are trying to redirect back to the same route.
Not sure why it worked in 1.2.x - we should probably understand it better but at the same time I would be tempted to say "won't fix" as there is an explicit infinite redirection in the example code.
Hi,
I didn't have this issue with 1.2.26. Extract of my code:
The
/maintenance
route has an empty controller. This code is causing an infinite loop, but not with 1.2.26. Got this error.I understand why there is an infinite loop as I don't test the current route before redirecting. Why it worked before?
Is it a bug or something that I skipped from the changelog?
Bests
The text was updated successfully, but these errors were encountered: