@@ -99,7 +99,7 @@ class DirectiveInjector implements DirectiveBinder {
99
99
, EVENT_HANDLER_KEY
100
100
, KEEP_ME_LAST
101
101
];
102
-
102
+
103
103
final DirectiveInjector parent;
104
104
final Injector appInjector;
105
105
final Node _node;
@@ -138,7 +138,7 @@ class DirectiveInjector implements DirectiveBinder {
138
138
}
139
139
}
140
140
141
- static Binding _temp_binding = new Binding ();
141
+ static Binding _tempBinding = new Binding ();
142
142
143
143
DirectiveInjector (parent, appInjector, this ._node, this ._nodeAttrs, this ._eventHandler,
144
144
this .scope, this ._animate)
@@ -152,21 +152,23 @@ class DirectiveInjector implements DirectiveBinder {
152
152
scope = null ,
153
153
_animate = null ;
154
154
155
- bind (key, {dynamic toValue: DEFAULT_VALUE ,
155
+ void bind (key, {dynamic toValue: DEFAULT_VALUE ,
156
156
Function toFactory: DEFAULT_VALUE ,
157
- Type toImplementation, inject: const [],
157
+ Type toImplementation,
158
+ toInstanceOf,
159
+ inject: const [],
158
160
Visibility visibility: Visibility .LOCAL }) {
159
161
if (key == null ) throw 'Key is required' ;
160
162
if (key is ! Key ) key = new Key (key);
161
163
if (inject is ! List ) inject = [inject];
162
164
163
- _temp_binding .bind (key, Module .DEFAULT_REFLECTOR , toValue: toValue, toFactory: toFactory,
164
- toImplementation: toImplementation, inject: inject);
165
+ _tempBinding .bind (key, Module .DEFAULT_REFLECTOR , toValue: toValue, toFactory: toFactory,
166
+ toImplementation: toImplementation, inject: inject, toInstanceOf : toInstanceOf );
165
167
166
- bindByKey (key, _temp_binding .factory , _temp_binding .parameterKeys, visibility);
168
+ bindByKey (key, _tempBinding .factory , _tempBinding .parameterKeys, visibility);
167
169
}
168
170
169
- bindByKey (Key key, Function factory , List <Key > parameterKeys, [Visibility visibility]) {
171
+ void bindByKey (Key key, Function factory , List <Key > parameterKeys, [Visibility visibility]) {
170
172
if (visibility == null ) visibility = Visibility .CHILDREN ;
171
173
int visibilityId = _toVisId (visibility);
172
174
int keyVisId = key.uid;
@@ -211,7 +213,7 @@ class DirectiveInjector implements DirectiveBinder {
211
213
return isDirective ? _getDirectiveByKey (key, uid, appInjector) : _getById (uid);
212
214
}
213
215
214
- _getDirectiveByKey (Key k, int visType, Injector i) {
216
+ Object _getDirectiveByKey (Key k, int visType, Injector i) {
215
217
do {
216
218
if (_key0 == null ) break ; if (identical (_key0, k)) return _obj0 == null ? _obj0 = _new (_pKeys0, _factory0) : _obj0;
217
219
if (_key1 == null ) break ; if (identical (_key1, k)) return _obj1 == null ? _obj1 = _new (_pKeys1, _factory1) : _obj1;
@@ -340,7 +342,7 @@ class TemplateDirectiveInjector extends DirectiveInjector {
340
342
final ViewFactory _viewFactory;
341
343
ViewPort _viewPort;
342
344
BoundViewFactory _boundViewFactory;
343
-
345
+
344
346
TemplateDirectiveInjector (DirectiveInjector parent, Injector appInjector,
345
347
Node node, NodeAttrs nodeAttrs, EventHandler eventHandler,
346
348
Scope scope, Animate animate, this ._viewFactory)
@@ -357,7 +359,7 @@ class TemplateDirectiveInjector extends DirectiveInjector {
357
359
default : return super ._getById (keyId);
358
360
}
359
361
}
360
-
362
+
361
363
}
362
364
363
365
abstract class ComponentDirectiveInjector extends DirectiveInjector {
0 commit comments