aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeff Cross2013-12-04 14:33:58 -0800
committerTobias Bosch2013-12-04 15:29:19 -0800
commitd802ed1b3680cfc1751777fac465b92ee29944dc (patch)
tree923f6bb914c25c39ff5758a9dd83eb6bfa68d1e0 /src
parente8f4305e9d1587512dbef44733fd162caa1cef59 (diff)
downloadangular.js-d802ed1b3680cfc1751777fac465b92ee29944dc.tar.bz2
fix($rootScope): broadcast $destroy event on $rootScope
Fixes #5169
Diffstat (limited to 'src')
-rw-r--r--src/ng/rootScope.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js
index 13ee4c70..a54fdc98 100644
--- a/src/ng/rootScope.js
+++ b/src/ng/rootScope.js
@@ -670,11 +670,12 @@ function $RootScopeProvider(){
*/
$destroy: function() {
// we can't destroy the root scope or a scope that has been already destroyed
- if ($rootScope == this || this.$$destroyed) return;
+ if (this.$$destroyed) return;
var parent = this.$parent;
this.$broadcast('$destroy');
this.$$destroyed = true;
+ if (this === $rootScope) return;
if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;
if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;