diff --git a/modules/@angular/compiler/src/metadata_resolver.ts b/modules/@angular/compiler/src/metadata_resolver.ts index 514ddafd6e..b3e73317a8 100644 --- a/modules/@angular/compiler/src/metadata_resolver.ts +++ b/modules/@angular/compiler/src/metadata_resolver.ts @@ -84,7 +84,7 @@ export class CompileMetadataResolver { var templateMeta = null; var changeDetectionStrategy = null; var viewProviders = []; - + var moduleUrl = staticTypeModuleUrl(directiveType); if (dirMeta instanceof ComponentMetadata) { assertArrayOfStrings('styles', dirMeta.styles); var cmpMeta = dirMeta; @@ -101,6 +101,7 @@ export class CompileMetadataResolver { if (isPresent(dirMeta.viewProviders)) { viewProviders = this.getProvidersMetadata(dirMeta.viewProviders); } + moduleUrl = componentModuleUrl(this._reflector, directiveType, cmpMeta); } var providers = []; @@ -117,10 +118,7 @@ export class CompileMetadataResolver { selector: dirMeta.selector, exportAs: dirMeta.exportAs, isComponent: isPresent(templateMeta), - type: this.getTypeMetadata(directiveType, - isPresent(cmpMeta) ? - componentModuleUrl(this._reflector, directiveType, cmpMeta) : - staticTypeModuleUrl(dirMeta)), + type: this.getTypeMetadata(directiveType, moduleUrl), template: templateMeta, changeDetection: changeDetectionStrategy, inputs: dirMeta.inputs,