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.
However, ngRoute still locks down the browser's hash location, forcing all window.location.hash changes to the $routeProvider.otherwise() setting.
For example, configuration:
$routeProvider
.when('/', {
...
})
.when('/page2', {
...
})
.otherwise({
redirectTo: '/'
});
After closing the popup and destroying the rootScope that configured the route, changes to window.location.hash, get reverted to '#/'.
Stepping through the code, it seems that the "$browser.startPoller" function (https://code.angularjs.org/1.2.20/angular.js line: 4431) is never properly stopped/cleared, which in turn triggers ngRoute on every hash change.
The text was updated successfully, but these errors were encountered:
Although this 'works' in my case, it is no way a solution, it does not stop the $browser/$location service from polling, and overriding the hash url with the / prefix. It does stop however the redirection to the routed pages. I would definitely not recommend to use it if there is another way you can make your code working.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In our application we use angular for all popup windows, a popup window has multlple pages (wizard-like) and are controller by ngRoute.
As the popup closes, we implicitly destruct the $rootScope:
angular.element('#modal-content').scope().$root.$destroy();
However, ngRoute still locks down the browser's hash location, forcing all window.location.hash changes to the $routeProvider.otherwise() setting.
For example, configuration:
$routeProvider
.when('/', {
...
})
.when('/page2', {
...
})
.otherwise({
redirectTo: '/'
});
After closing the popup and destroying the rootScope that configured the route, changes to window.location.hash, get reverted to '#/'.
Stepping through the code, it seems that the "$browser.startPoller" function (https://code.angularjs.org/1.2.20/angular.js line: 4431) is never properly stopped/cleared, which in turn triggers ngRoute on every hash change.
The text was updated successfully, but these errors were encountered: