@@ -107,6 +107,7 @@ class DirectiveInjector implements DirectiveBinder {
107
107
final Animate _animate;
108
108
final EventHandler _eventHandler;
109
109
Scope scope; //TODO(misko): this should be final after we get rid of controller
110
+ final View _view;
110
111
111
112
NgElement _ngElement;
112
113
ElementProbe _elementProbe;
@@ -140,15 +141,18 @@ class DirectiveInjector implements DirectiveBinder {
140
141
141
142
static Binding _tempBinding = new Binding ();
142
143
143
- DirectiveInjector (this ._parent, appInjector, this ._node, this ._nodeAttrs,
144
- this ._eventHandler, this .scope, this ._animate)
145
- : _appInjector = appInjector;
144
+ DirectiveInjector (DirectiveInjector parent, appInjector, this ._node, this ._nodeAttrs,
145
+ this ._eventHandler, this .scope, this ._animate, [View view])
146
+ : _parent = parent,
147
+ _appInjector = appInjector,
148
+ _view = view == null && parent != null ? parent._view : view;
146
149
147
150
DirectiveInjector ._default (this ._parent, this ._appInjector)
148
151
: _node = null ,
149
152
_nodeAttrs = null ,
150
153
_eventHandler = null ,
151
154
scope = null ,
155
+ _view = null ,
152
156
_animate = null ;
153
157
154
158
void bind (key, {dynamic toValue: DEFAULT_VALUE ,
@@ -291,6 +295,7 @@ class DirectiveInjector implements DirectiveBinder {
291
295
currentInjector = currentInjector._parent;
292
296
}
293
297
return null ;
298
+ case VIEW_KEY_ID : return _view;
294
299
default : new NoProviderError (_KEYS [keyId]);
295
300
}
296
301
}
@@ -371,8 +376,8 @@ class TemplateDirectiveInjector extends DirectiveInjector {
371
376
372
377
TemplateDirectiveInjector (DirectiveInjector parent, Injector appInjector,
373
378
Node node, NodeAttrs nodeAttrs, EventHandler eventHandler,
374
- Scope scope, Animate animate, this ._viewFactory)
375
- : super (parent, appInjector, node, nodeAttrs, eventHandler, scope, animate);
379
+ Scope scope, Animate animate, this ._viewFactory, [ View view] )
380
+ : super (parent, appInjector, node, nodeAttrs, eventHandler, scope, animate, view );
376
381
377
382
378
383
Object _getById (int keyId) {
@@ -396,9 +401,9 @@ class ComponentDirectiveInjector extends DirectiveInjector {
396
401
397
402
ComponentDirectiveInjector (DirectiveInjector parent, Injector appInjector,
398
403
EventHandler eventHandler, Scope scope,
399
- this ._templateLoader, this ._shadowRoot, this ._contentPort)
404
+ this ._templateLoader, this ._shadowRoot, this ._contentPort, [ View view] )
400
405
: super (parent, appInjector, parent._node, parent._nodeAttrs, eventHandler, scope,
401
- parent._animate);
406
+ parent._animate, view );
402
407
403
408
Object _getById (int keyId) {
404
409
switch (keyId) {
0 commit comments