refactor(compiler): never create CompileDirectiveMetadata with not loaded resources (#12788)

Part of #12787
This commit is contained in:
Tobias Bosch
2016-11-10 14:07:30 -08:00
committed by Victor Berchet
parent c3c0e2e2a2
commit 79383ce150
14 changed files with 1165 additions and 935 deletions

View File

@ -22,6 +22,8 @@ function _isNgModuleMetadata(obj: any): obj is NgModule {
export class NgModuleResolver {
constructor(private _reflector: ReflectorReader = reflector) {}
isNgModule(type: any) { return this._reflector.annotations(type).some(_isNgModuleMetadata); }
resolve(type: Type<any>, throwIfNotFound = true): NgModule {
const ngModuleMeta: NgModule = this._reflector.annotations(type).find(_isNgModuleMetadata);