fix(transformer): Fix generation of `annotations` argument when registering functions.
This commit is contained in:
parent
d84993faf1
commit
2faa89852b
|
@ -297,9 +297,9 @@ class CreateNgDepsVisitor extends Object with SimpleAstVisitor<Object> {
|
|||
_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;
|
||||
|
|
|
@ -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 []));
|
||||
}
|
||||
|
|
|
@ -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() {}
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue