diff --git a/lib/core_dom/directive_injector.dart b/lib/core_dom/directive_injector.dart index 2c0f70329..e62ba4a6d 100644 --- a/lib/core_dom/directive_injector.dart +++ b/lib/core_dom/directive_injector.dart @@ -387,7 +387,7 @@ class DirectiveInjector implements DirectiveBinder { NgElement get ngElement { if (_ngElement == null) { - _ngElement = new NgElement(_node, scope, _animate, _destLightDom); + _ngElement = new NgElement(_node, _appInjector.getByKey(ROOT_SCOPE_KEY), _animate, _destLightDom); } return _ngElement; } diff --git a/lib/core_dom/ng_element.dart b/lib/core_dom/ng_element.dart index 29f7b9992..a204c9378 100644 --- a/lib/core_dom/ng_element.dart +++ b/lib/core_dom/ng_element.dart @@ -5,7 +5,7 @@ class NgElement { static const _TO_BE_REMOVED = const Object(); final dom.Element node; - final Scope _scope; + final RootScope _rootScope; final Animate _animate; final DestinationLightDom _lightDom; @@ -14,7 +14,7 @@ class NgElement { bool _writeScheduled = false; - NgElement(this.node, this._scope, this._animate, [this._lightDom]); + NgElement(this.node, this._rootScope, this._animate, [this._lightDom]); void addClass(String className) { _scheduleDomWrite(); @@ -40,7 +40,7 @@ class NgElement { _scheduleDomWrite() { if (!_writeScheduled) { _writeScheduled = true; - _scope.rootScope.domWrite(() { + _rootScope.domWrite(() { _writeToDom(); _notifyLightDom(); _writeScheduled = false;