NgModule dynamically loaded - check if it is already present

We load many SystemJs modules and the Angular 2 compiler ... for example:

 System.import(modulePath)
       .then((module: any) => {
            moduleType = module[moduleTypeName];
            componentType = module[componentTypeName];
                            return this.compiler.compileModuleAndAllComponentsAsync(<any>moduleType);
                        })......
Run codeHide result

Now I just would like to know, for example, the next cycle if the module is already loaded and compiled using Angular 2 .... so that I could get right componentFactory right and create a new one without loading modules again and again

+4
source share

Source: https://habr.com/ru/post/1655331/


All Articles