refactor(module-loader): fix tests, don't purge loaded module promise from the map

fix tests, don't purge loaded module promise from the map
This commit is contained in:
Dan Bucholtz
2017-04-18 15:05:52 -05:00
parent f88823a30f
commit ff467db339
2 changed files with 79 additions and 63 deletions

View File

@@ -36,11 +36,8 @@ export class ModuleLoader {
}
return promise.then(loadedModule => {
// clear it from the cache
this._promiseMap.delete(modulePath);
console.timeEnd(`ModuleLoader, load: ${modulePath}'`);
const ref = loadedModule.create(this._injector);
const component = ref.injector.get(LAZY_LOADED_TOKEN);
this._cfrMap.set(component, ref.componentFactoryResolver);