@smartsoft001/angular 1.1.656 → 1.1.657
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/smartsoft001-angular.umd.js +1 -1
- package/bundles/smartsoft001-angular.umd.js.map +1 -1
- package/esm2015/lib/services/dynamic-component-storage/dynamic-component-storage.service.js +1 -1
- package/esm2015/lib/services/dynamic-component-storage/dynamic-component-storage.service.js.map +1 -1
- package/fesm2015/smartsoft001-angular.js +1 -1
- package/fesm2015/smartsoft001-angular.js.map +1 -1
- package/package.json +5 -5
|
@@ -9,7 +9,7 @@ export class DynamicComponentStorageService {
|
|
|
9
9
|
.filter(c => c['smartType'] === k);
|
|
10
10
|
};
|
|
11
11
|
let components = getComponents(key, moduleRef);
|
|
12
|
-
if (!components.length) {
|
|
12
|
+
if (!components.length && moduleRef) {
|
|
13
13
|
const applicationRef = moduleRef.injector.get(ApplicationRef);
|
|
14
14
|
let appComponentInjector = (_a = applicationRef.components
|
|
15
15
|
.find(t => t.componentType.name === "AppComponent")) === null || _a === void 0 ? void 0 : _a.injector;
|
package/esm2015/lib/services/dynamic-component-storage/dynamic-component-storage.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-component-storage.service.js","sourceRoot":"","sources":["../../../../../../../../libs/shared/angular/src/lib/services/dynamic-component-storage/dynamic-component-storage.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,WAAW,EAAO,MAAM,eAAe,CAAC;AAIhE,MAAM,OAAO,8BAA8B;IACvC,MAAM,CAAC,GAAG,CAAC,GAAyB,EAAE,SAA2B;;QAC7D,MAAM,aAAa,GAAG,CAAC,CAAuB,EAAE,CAAmB,EAAe,EAAE;YAChF,IAAI,CAAC,CAAC;gBAAE,OAAO,EAAE,CAAC;YAElB,OAAQ,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,YAAY;iBAC9C,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAA;QAC1C,CAAC,CAAA;QAED,IAAI,UAAU,GAAG,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAE/C,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"dynamic-component-storage.service.js","sourceRoot":"","sources":["../../../../../../../../libs/shared/angular/src/lib/services/dynamic-component-storage/dynamic-component-storage.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,WAAW,EAAO,MAAM,eAAe,CAAC;AAIhE,MAAM,OAAO,8BAA8B;IACvC,MAAM,CAAC,GAAG,CAAC,GAAyB,EAAE,SAA2B;;QAC7D,MAAM,aAAa,GAAG,CAAC,CAAuB,EAAE,CAAmB,EAAe,EAAE;YAChF,IAAI,CAAC,CAAC;gBAAE,OAAO,EAAE,CAAC;YAElB,OAAQ,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,YAAY;iBAC9C,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAA;QAC1C,CAAC,CAAA;QAED,IAAI,UAAU,GAAG,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAE/C,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,SAAS,EAAE;YACjC,MAAM,cAAc,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YAC9D,IAAI,oBAAoB,GAAG,MAAA,cAAc,CAAC,UAAU;iBAC/C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,KAAK,cAAc,CAAC,0CAAE,QAAQ,CAAC;YAElE,IAAI,CAAC,oBAAoB,EAAE;gBACvB,oBAAoB,GAAG,MAAA,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,0CAAE,QAAQ,CAAC;aACjE;YAED,IAAI,CAAC,oBAAoB,EAAE;gBACvB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,IAAI,GAAG,yBAAyB,CAAC,CAAC;aACpF;YAED,MAAM,YAAY,GAAG,oBAAoB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YAE3D,UAAU,GAAG,aAAa,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;SACjD;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ","sourcesContent":["import {ApplicationRef, NgModuleRef, Type} from \"@angular/core\";\n\nimport {DynamicComponentType} from \"../../models\";\n\nexport class DynamicComponentStorageService {\n static get(key: DynamicComponentType, moduleRef: NgModuleRef<any>): Type<any>[] {\n const getComponents = (k: DynamicComponentType, m: NgModuleRef<any>): Type<any>[] => {\n if (!m) return [];\n\n return m.instance.constructor['ɵmod'].declarations\n .filter(c => c['smartType'] === k)\n }\n\n let components = getComponents(key, moduleRef);\n\n if (!components.length && moduleRef) {\n const applicationRef = moduleRef.injector.get(ApplicationRef);\n let appComponentInjector = applicationRef.components\n .find(t => t.componentType.name === \"AppComponent\")?.injector;\n\n if (!appComponentInjector) {\n appComponentInjector = applicationRef.components[0]?.injector;\n }\n\n if (!appComponentInjector) {\n throw new Error(DynamicComponentStorageService.name + \" not found AppComponent\");\n }\n\n const appModuleRef = appComponentInjector.get(NgModuleRef);\n\n components = getComponents(key, appModuleRef);\n }\n\n return components;\n }\n}"]}
|
|
@@ -2123,7 +2123,7 @@ class DynamicComponentStorageService {
|
|
|
2123
2123
|
.filter(c => c['smartType'] === k);
|
|
2124
2124
|
};
|
|
2125
2125
|
let components = getComponents(key, moduleRef);
|
|
2126
|
-
if (!components.length) {
|
|
2126
|
+
if (!components.length && moduleRef) {
|
|
2127
2127
|
const applicationRef = moduleRef.injector.get(ApplicationRef);
|
|
2128
2128
|
let appComponentInjector = (_a = applicationRef.components
|
|
2129
2129
|
.find(t => t.componentType.name === "AppComponent")) === null || _a === void 0 ? void 0 : _a.injector;
|