feat(router): register NgModuleFactory objects. (#11211)

When lazily loading code, users need to be able to get hold of the
NgModuleFactory. For SystemJS environments, the SystemJS registry serves
this purpose. However other environments, such as modules compiled with
Closure compiler, do not expose exports object or a path based registry.

For these environments, `@NgModule` objects can include an identifier, and
the loading code can then pass `loadModule(id).then(() =>
getNgModule(id))` to the router.
This commit is contained in:
Martin Probst
2016-09-01 13:46:08 -07:00
committed by GitHub
parent c9e5b599e4
commit ebc8e808a9
11 changed files with 99 additions and 8 deletions

View File

@ -328,7 +328,8 @@ export class CompileMetadataResolver {
exportedPipes: exportedPipes,
importedModules: importedModules,
exportedModules: exportedModules,
transitiveModule: transitiveModule
transitiveModule: transitiveModule,
id: meta.id,
});
transitiveModule.modules.push(compileMeta);
this._verifyModule(compileMeta);