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.

Remove popstate/hashchange event handler when app is torn down #9897

Closed
@randombk

Description

@randombk

When bootstrapping an app, angularjs adds an event listener to window to handle popstate and hashchange events (File /src/ng/browser.js on lines 285 and 287). This is not removed during teardown of the app, meaning that a later instance will be affected by the route/state configuration of the previous app (See issue #9877).

These handlers should be deregistered when the app's root DOM element is removed, or when $destroy() is called on an app's $rootScope. For the most part, this looks to be the only handler not attached to the app's DOM root, judging by a quick search for "jqLite(window).on", so fixing this should go a long way towards being able to fully tear down and remove every part of an angular application without requiring a page refresh.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions