diff --git a/modules/angular2/src/transform/directive_processor/rewriter.dart b/modules/angular2/src/transform/directive_processor/rewriter.dart index 5ad3a675b2..31ae3566b6 100644 --- a/modules/angular2/src/transform/directive_processor/rewriter.dart +++ b/modules/angular2/src/transform/directive_processor/rewriter.dart @@ -297,9 +297,9 @@ class CreateNgDepsVisitor extends Object with SimpleAstVisitor { _maybeWriteReflector(); writer.print('..registerFunction('); node.name.accept(this); - writer.print(', new ${_REF_PREFIX}.ReflectionInfo('); + writer.print(', new ${_REF_PREFIX}.ReflectionInfo(const ['); node.metadata.accept(_metaVisitor); - writer.print(', const ['); + writer.print('], const ['); node.functionExpression.parameters.accept(_paramsVisitor); writer.print(']))'); return null; diff --git a/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/expected/hello.ng_deps.dart b/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/expected/hello.ng_deps.dart index 685696b0a4..4e19709bce 100644 --- a/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/expected/hello.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/expected/hello.ng_deps.dart @@ -17,5 +17,7 @@ void initReflector() { template: r'''{{greeting}}''', templateUrl: r'package:other_package/template.html', styles: const [r'''.greeting { .color: blue; }''',]) - ], const [], () => new HelloCmp())); + ], const [], () => new HelloCmp())) + ..registerFunction( + hello, new _ngRef.ReflectionInfo(const [const Injectable()], const [])); } diff --git a/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/hello.dart b/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/hello.dart index 466222be57..1015364625 100644 --- a/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/hello.dart +++ b/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/hello.dart @@ -8,3 +8,6 @@ import 'package:angular2/angular2.dart' templateUrl: 'package:other_package/template.html', styleUrls: const ['package:other_package/template.css']) class HelloCmp {} + +@Injectable() +hello() {} diff --git a/modules/angular2/test/transform/directive_processor/static_function_files/expected/hello.ng_deps.dart b/modules/angular2/test/transform/directive_processor/static_function_files/expected/hello.ng_deps.dart index 9064a01952..b55192f087 100644 --- a/modules/angular2/test/transform/directive_processor/static_function_files/expected/hello.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/static_function_files/expected/hello.ng_deps.dart @@ -11,7 +11,7 @@ void initReflector() { _visited = true; _ngRef.reflector ..registerFunction(getMessage, new _ngRef.ReflectionInfo( - const Injectable(), const [const [const Inject(Message)]])) + const [const Injectable()], const [const [const Inject(Message)]])) ..registerType(Message, new _ngRef.ReflectionInfo( const [const Injectable()], const [], () => new Message())); }