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

Commit 34e829b

Browse files
vicbchirayuk
authored andcommitted
fix: Remove deprecated calls to DI bind(Type, inject[])
fixes #1259 closes #1260
1 parent 46f6728 commit 34e829b

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

lib/core/module_internal.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ class CoreModule extends Module {
4040
bind(FormatterMap);
4141
bind(Interpolate);
4242
bind(RootScope);
43-
bind(Scope, inject: [RootScope]);
43+
bind(Scope, toInstanceOf: RootScope);
4444
bind(ClosureMap, toFactory: () => throw "Must provide dynamic/static ClosureMap.", inject: []);
4545
bind(ScopeStats);
4646
bind(ScopeStatsEmitter);
4747
bind(ScopeStatsConfig);
4848
bind(Object, toValue: {}); // RootScope context
4949

50-
bind(Parser, inject: [DynamicParser]);
51-
bind(ParserBackend, inject: [DynamicParserBackend]);
50+
bind(Parser, toInstanceOf: DynamicParser);
51+
bind(ParserBackend, toInstanceOf: DynamicParserBackend);
5252
bind(DynamicParser);
5353
bind(DynamicParserBackend);
5454
bind(Lexer);

lib/core_dom/module_internal.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ class CoreDomModule extends Module {
7272
bind(Compiler, toImplementation: TaggingCompiler);
7373
bind(CompilerConfig);
7474

75-
bind(ComponentFactory, inject: [SHADOW_DOM_COMPONENT_FACTORY_KEY]);
75+
bind(ComponentFactory, toInstanceOf: SHADOW_DOM_COMPONENT_FACTORY_KEY);
7676
bind(ShadowDomComponentFactory);
7777
bind(TranscludingComponentFactory);
7878
bind(Content);
7979
bind(ContentPort, toValue: null);
8080
bind(ComponentCssRewriter);
8181
bind(WebPlatform);
82-
82+
8383
bind(Http);
8484
bind(UrlRewriter);
8585
bind(HttpBackend);

lib/mock/module.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class AngularMockModule extends Module {
6363
bind(MockHttpBackend);
6464
bind(Element, toValue: document.body);
6565
bind(Node, toValue: document.body);
66-
bind(HttpBackend, inject:[MOCK_HTTP_BACKEND_KEY]);
66+
bind(HttpBackend, toInstanceOf: MOCK_HTTP_BACKEND_KEY);
6767
bind(VmTurnZone, toFactory: () {
6868
return new VmTurnZone()
6969
..onError = (e, s, LongStackTrace ls) => dump('EXCEPTION: $e\n$s\n$ls');

lib/tools/expression_extractor.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ main(args) {
5858
..bind(DynamicParser)
5959
..bind(DartGetterSetterGen)
6060
..bind(CacheRegister)
61-
..bind(Parser, inject: [DynamicParser])
62-
..bind(ParserBackend, inject: [DartGetterSetterGen]);
61+
..bind(Parser, toInstanceOf: DynamicParser)
62+
..bind(ParserBackend, toInstanceOf: DartGetterSetterGen);
6363
Injector injector = new ModuleInjector([module]);
6464

6565
runZoned(() {

test/core/parser/generated_getter_setter_spec.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import 'generated_getter_setter.dart' as gen;
77
main() {
88
describe('hybrid getter-setter', () {
99
beforeEachModule((Module module) {
10-
module..bind(Parser, inject: [DynamicParser])
10+
module..bind(Parser, toInstanceOf: DynamicParser)
1111
..bind(ClosureMap, toValue: gen.closureMap);
1212
});
1313
parser_spec.main();

0 commit comments

Comments
 (0)