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

ngRoute not properly destructed upon $destroy of $rootScope #8295

Closed
@Daanoz

Description

@Daanoz

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions