Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit bed6bcb

Browse files
committed
fix(element binder): Use the new-style Module.bind(toFactory) syntax
1 parent 68ba14e commit bed6bcb

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/core_dom/element_binder.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ class TemplateElementBinder extends ElementBinder {
2525
_registerViewFactory(node, parentInjector, nodeModule) {
2626
assert(templateViewFactory != null);
2727
nodeModule
28-
..bindByKey(VIEW_PORT_KEY, toFactory: (_) =>
28+
..bindByKey(VIEW_PORT_KEY, inject: const [], toFactory: () =>
2929
new ViewPort(node, parentInjector.getByKey(ANIMATE_KEY)))
3030
..bindByKey(VIEW_FACTORY_KEY, toValue: templateViewFactory)
31-
..bindByKey(BOUND_VIEW_FACTORY_KEY, toFactory: (Injector injector) =>
31+
..bindByKey(BOUND_VIEW_FACTORY_KEY, inject: const [Injector], toFactory: (Injector injector) =>
3232
templateViewFactory.bind(injector));
3333
}
3434
}
@@ -250,8 +250,8 @@ class ElementBinder {
250250
void _createDirectiveFactories(DirectiveRef ref, nodeModule, node, nodesAttrsDirectives, nodeAttrs,
251251
visibility) {
252252
if (ref.type == TextMustache) {
253-
nodeModule.bind(TextMustache, toFactory: (Injector injector) => new TextMustache(
254-
node, ref.valueAST, injector.getByKey(SCOPE_KEY)));
253+
nodeModule.bind(TextMustache, inject: const [Scope],
254+
toFactory: (Scope scope) => new TextMustache(node, ref.valueAST, scope));
255255
} else if (ref.type == AttrMustache) {
256256
if (nodesAttrsDirectives.isEmpty) {
257257
nodeModule.bind(AttrMustache, toFactory: (Injector injector) {
@@ -265,7 +265,8 @@ class ElementBinder {
265265
} else if (ref.annotation is Component) {
266266
assert(ref == componentData.ref);
267267

268-
nodeModule.bindByKey(ref.typeKey, toFactory: componentData.factory.call(node), visibility: visibility);
268+
nodeModule.bindByKey(ref.typeKey, inject: const [Injector],
269+
toFactory: componentData.factory.call(node), visibility: visibility);
269270
} else {
270271
nodeModule.bindByKey(ref.typeKey, visibility: visibility);
271272
}
@@ -297,7 +298,7 @@ class ElementBinder {
297298
..bindByKey(NODE_ATTRS_KEY, toValue: nodeAttrs);
298299

299300
if (_config.elementProbeEnabled) {
300-
nodeModule.bindByKey(ELEMENT_PROBE_KEY, toFactory: (_) => probe);
301+
nodeModule.bindByKey(ELEMENT_PROBE_KEY, inject: const [], toFactory: () => probe);
301302
}
302303

303304
directiveRefs.forEach((DirectiveRef ref) {

0 commit comments

Comments
 (0)