This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Remove popstate/hashchange event handler when app is torn down #9897
Milestone
Comments
randombk
added a commit
to randombk/angular.js
that referenced
this issue
Nov 4, 2014
Remember the popstate and hashchange handler registered with window when the application bootstraps, and remove it when the application is torn down Closes angular#9897
randombk
added a commit
to randombk/angular.js
that referenced
this issue
Nov 4, 2014
Remember the popstate and hashchange handler registered with window when the application bootstraps, and remove it when the application is torn down Closes angular#9897
randombk
added a commit
to randombk/angular.js
that referenced
this issue
Nov 4, 2014
Remember the popstate and hashchange handler registered with window when the application bootstraps, and remove it when the application is torn down Closes angular#9897
I opened a pull request for a fix. I've already signed the CLA. |
randombk
added a commit
to randombk/angular.js
that referenced
this issue
Nov 4, 2014
Remember the popstate and hashchange handler registered with window when the application bootstraps, and remove it when the application is torn down Closes angular#9897
randombk
added a commit
to randombk/angular.js
that referenced
this issue
Nov 4, 2014
Remember the popstate and hashchange handler registered with window when the application bootstraps, and remove it when the application is torn down Closes angular#9897
randombk
added a commit
to randombk/angular.js
that referenced
this issue
Nov 4, 2014
Remember the popstate and hashchange handler registered with window when the application bootstraps, and remove it when the application is torn down Closes angular#9897
randombk
added a commit
to randombk/angular.js
that referenced
this issue
Dec 3, 2014
Remember the popstate and hashchange handler registered with window when the application bootstraps, and remove it when the application is torn down Closes angular#9897
netman92
pushed a commit
to netman92/angular.js
that referenced
this issue
Aug 8, 2015
Remember the popstate and hashchange handler registered with window when the application bootstraps, and remove it when the application is torn down Closes angular#9897 Closes angular#9905
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The text was updated successfully, but these errors were encountered: