aboutsummaryrefslogtreecommitdiffstats
path: root/src/service/scope.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/scope.js')
-rw-r--r--src/service/scope.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/service/scope.js b/src/service/scope.js
index ef1b7b93..b7ee61d6 100644
--- a/src/service/scope.js
+++ b/src/service/scope.js
@@ -136,7 +136,6 @@ function $RootScopeProvider(){
this.$$phase = this.$parent = this.$$watchers =
this.$$nextSibling = this.$$prevSibling =
this.$$childHead = this.$$childTail = null;
- this.$destructor = noop;
this['this'] = this.$root = this;
this.$$asyncQueue = [];
this.$$listeners = {};
@@ -458,6 +457,8 @@ function $RootScopeProvider(){
if (this.$root == this) return; // we can't remove the root node;
var parent = this.$parent;
+ this.$broadcast('$destroy');
+
if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;
if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;
if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;