refactor(compiler): allows synchronous retrieving of metadata (#12908)

Allows non-normalized metadata to be retrieved synchronously.

Related to #7482
This commit is contained in:
Chuck Jazdzewski
2016-11-16 10:22:11 -08:00
committed by Victor Berchet
parent 8b2dfb2eca
commit 481c9b3258
4 changed files with 234 additions and 161 deletions

View File

@ -589,7 +589,7 @@ export interface CompileNgModuleDirectiveSummary extends CompileSummary {
exportedDirectives: CompileIdentifierMetadata[];
exportedPipes: CompileIdentifierMetadata[];
exportedModules: CompileNgModuleDirectiveSummary[];
loadingPromises: Promise<any>[];
directiveLoaders: (() => Promise<void>)[];
}
export type CompileNgModuleSummary =
@ -661,7 +661,7 @@ export class CompileNgModuleMetadata implements CompileMetadataWithIdentifier {
exportedModules: this.exportedModules,
exportedDirectives: this.exportedDirectives,
exportedPipes: this.exportedPipes,
loadingPromises: this.transitiveModule.loadingPromises
directiveLoaders: this.transitiveModule.directiveLoaders
};
}
@ -682,7 +682,7 @@ export class CompileNgModuleMetadata implements CompileMetadataWithIdentifier {
exportedDirectives: this.exportedDirectives,
exportedPipes: this.exportedPipes,
exportedModules: this.exportedModules,
loadingPromises: this.transitiveModule.loadingPromises
directiveLoaders: this.transitiveModule.directiveLoaders
};
}
}
@ -695,7 +695,7 @@ export class TransitiveCompileNgModuleMetadata {
public modules: CompileNgModuleInjectorSummary[], public providers: CompileProviderMetadata[],
public entryComponents: CompileIdentifierMetadata[],
public directives: CompileIdentifierMetadata[], public pipes: CompileIdentifierMetadata[],
public loadingPromises: Promise<any>[]) {
public directiveLoaders: (() => Promise<void>)[]) {
directives.forEach(dir => this.directivesSet.add(dir.reference));
pipes.forEach(pipe => this.pipesSet.add(pipe.reference));
}