diff --git a/modules/@angular/compiler_cli/integrationtest/src/a/multiple_components.ts b/modules/@angular/compiler_cli/integrationtest/src/a/multiple_components.ts index e632ad8d80..28a29c3ed8 100644 --- a/modules/@angular/compiler_cli/integrationtest/src/a/multiple_components.ts +++ b/modules/@angular/compiler_cli/integrationtest/src/a/multiple_components.ts @@ -19,3 +19,9 @@ export function NotADirective(c: any): void {} @NotADirective export class HasCustomDecorator { } + +// Verify that custom decorators have metadata collected, eg Ionic +export function Page(c: any): (f: Function) => void {return c;} + +@Page({template: 'Ionic template'}) +export class AnIonicPage {} diff --git a/modules/@angular/compiler_cli/src/static_reflector.ts b/modules/@angular/compiler_cli/src/static_reflector.ts index c2feed5ef1..80f2ac8bda 100644 --- a/modules/@angular/compiler_cli/src/static_reflector.ts +++ b/modules/@angular/compiler_cli/src/static_reflector.ts @@ -345,8 +345,12 @@ export class StaticReflector implements ReflectorReader { case "new": case "call": let target = expression['expression']; - staticSymbol = + if (target['module']) { + staticSymbol = _this.host.findDeclaration(target['module'], target['name'], context.filePath); + } else { + staticSymbol = _this.host.getStaticSymbol(context.filePath, target['name']); + } let converter = _this.conversionMap.get(staticSymbol); if (converter) { let args = expression['arguments'];