refactor(Directive): drop moduleId
moduleId is only used by components to resolve urls. Directives have no templates and do not need moduleId. Closes #5873
This commit is contained in:
@ -32,12 +32,13 @@ export class RuntimeMetadataResolver {
|
||||
var meta = this._cache.get(directiveType);
|
||||
if (isBlank(meta)) {
|
||||
var dirMeta = this._directiveResolver.resolve(directiveType);
|
||||
var moduleUrl = calcModuleUrl(directiveType, dirMeta);
|
||||
var moduleUrl = null;
|
||||
var templateMeta = null;
|
||||
var changeDetectionStrategy = null;
|
||||
|
||||
if (dirMeta instanceof md.ComponentMetadata) {
|
||||
var cmpMeta = <md.ComponentMetadata>dirMeta;
|
||||
moduleUrl = calcModuleUrl(directiveType, cmpMeta);
|
||||
var viewMeta = this._viewResolver.resolve(directiveType);
|
||||
templateMeta = new cpl.CompileTemplateMetadata({
|
||||
encapsulation: viewMeta.encapsulation,
|
||||
@ -107,8 +108,8 @@ function isValidDirective(value: Type): boolean {
|
||||
return isPresent(value) && (value instanceof Type);
|
||||
}
|
||||
|
||||
function calcModuleUrl(type: Type, dirMeta: md.DirectiveMetadata): string {
|
||||
var moduleId = dirMeta.moduleId;
|
||||
function calcModuleUrl(type: Type, cmpMetadata: md.ComponentMetadata): string {
|
||||
var moduleId = cmpMetadata.moduleId;
|
||||
if (isPresent(moduleId)) {
|
||||
var scheme = getUrlScheme(moduleId);
|
||||
return isPresent(scheme) && scheme.length > 0 ? moduleId :
|
||||
|
Reference in New Issue
Block a user