feat(core): expose a Compiler API for accessing module ids from NgModule types (#24258)
This will allow RouterTestingModule to better support lazy loading of modules when using summaries, since it can detect whether a module is already loaded if it can access the id. PR Close #24258
This commit is contained in:

committed by
Miško Hevery

parent
e3759f7a73
commit
bd02b27ee1
@ -78,6 +78,10 @@ export class CompilerImpl implements Compiler {
|
||||
}
|
||||
clearCache(): void { this._delegate.clearCache(); }
|
||||
clearCacheFor(type: Type<any>) { this._delegate.clearCacheFor(type); }
|
||||
getModuleId(moduleType: Type<any>): string|undefined {
|
||||
const meta = this._metadataResolver.getNgModuleMetadata(moduleType);
|
||||
return meta && meta.id || undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user