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

Commit a30c0a5

Browse files
committed
fix(various): Use the new-style Module.bind(toFactory) syntax
1 parent bed6bcb commit a30c0a5

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

lib/core_dom/shadow_dom_component_factory.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class BoundShadowDomComponentFactory implements BoundComponentFactory {
171171
..bindByKey(SHADOW_ROOT_KEY, toValue: shadowDom);
172172

173173
if (_f.config.elementProbeEnabled) {
174-
shadowModule.bindByKey(ELEMENT_PROBE_KEY, toFactory: (_) => probe);
174+
shadowModule.bindByKey(ELEMENT_PROBE_KEY, inject: const [], toFactory: () => probe);
175175
}
176176

177177
shadowInjector = injector.createChild([shadowModule], name: SHADOW_DOM_INJECTOR_NAME);

lib/core_dom/transcluding_component_factory.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class BoundTranscludingComponentFactory implements BoundComponentFactory {
151151
..bind(dom.ShadowRoot, toValue: new ShadowlessShadowRoot(element));
152152

153153
if (_f.config.elementProbeEnabled) {
154-
childModule.bind(ElementProbe, toFactory: (_) => probe);
154+
childModule.bind(ElementProbe, inject: const [], toFactory: () => probe);
155155
}
156156
childInjector = injector.createChild([childModule], name: SHADOW_DOM_INJECTOR_NAME);
157157
if (childInjectorCompleter != null) {

lib/directive/ng_form.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ part of angular.directive;
2020
map: const { 'ng-form': '@name' })
2121
class NgForm extends NgControl {
2222
static final Module _module = new Module()
23-
..bind(NgControl, toFactory: (i) => i.getByKey(NG_FORM_KEY));
23+
..bind(NgControl, inject: const [NgForm]);
2424
static module() => _module;
2525

2626
final Scope _scope;

lib/routing/ng_bind_route.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class NgBindRoute implements RouteProvider {
3232
final Injector _injector;
3333

3434
static final Module _module = new Module()
35-
..bind(RouteProvider, toFactory: (i) => i.getByKey(NG_BIND_ROUTE_KEY),
35+
..bind(RouteProvider, inject: const [NgBindRoute],
3636
visibility: Directive.CHILDREN_VISIBILITY);
3737

3838
static Module module() => _module;

lib/routing/ng_view.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ part of angular.routing;
5656
module: NgView.module)
5757
class NgView implements DetachAware, RouteProvider {
5858
static final Module _module = new Module()
59-
..bind(RouteProvider, toFactory: (i) => i.getByKey(NG_VIEW_KEY));
59+
..bind(RouteProvider, inject: const [NgView]);
6060

6161
static Module module() => _module;
6262

lib/tools/transformer/expression_generator.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class ExpressionGenerator extends Transformer with ResolverTransformer {
4646
.forEach(htmlExtractor.parseHtml)
4747
.then((_) {
4848
var module = new Module()
49-
..bind(Parser, toFactory: (i) => i.get(DynamicParser))
50-
..bind(ParserBackend, toFactory: (i) => i.get(DartGetterSetterGen));
49+
..bind(Parser, inject: const [DynamicParser])
50+
..bind(ParserBackend, inject: const [DartGetterSetterGen]);
5151
var injector =
5252
new DynamicInjector(modules: [module], allowImplicitInjection: true);
5353

0 commit comments

Comments
 (0)