@wavemaker/angular-codegen 10.11.0-next.24129 → 11.0.0-next.139409
Sign up to get free protection for your applications and to get access to all the features.
- angular-codegen/angular-app/angular.json +80 -79
- angular-codegen/angular-app/package-lock.json +12353 -11079
- angular-codegen/angular-app/package.json +18 -17
- angular-codegen/angular-app/src/framework/services/lazy-component-ref-provider.service.ts +31 -20
- angular-codegen/angular-app/src/main.ts +1 -1
- angular-codegen/dependencies/transpilation-mobile.cjs.js +7242 -9086
- angular-codegen/dependencies/transpilation-web.cjs.js +7242 -9086
- angular-codegen/package.json +1 -1
- angular-codegen/src/codegen.js +1 -1
- angular-codegen/src/handlebar-helpers.js +1 -1
- angular-codegen/src/update-angular-json.js +1 -1
- angular-codegen/angular-app/src/framework/util/lazy-module-routes.ts +0 -4
- angular-codegen/src/gen-lazy-module-routes.js +0 -1
- angular-codegen/templates/lazy-module-routes.ts.hbs +0 -3
@@ -18,15 +18,15 @@
|
|
18
18
|
},
|
19
19
|
"private": true,
|
20
20
|
"dependencies": {
|
21
|
-
"@angular/animations": "
|
22
|
-
"@angular/common": "
|
23
|
-
"@angular/compiler": "
|
24
|
-
"@angular/core": "
|
25
|
-
"@angular/forms": "
|
26
|
-
"@angular/platform-browser": "
|
27
|
-
"@angular/platform-browser-dynamic": "
|
28
|
-
"@angular/router": "
|
29
|
-
"@angular/service-worker": "
|
21
|
+
"@angular/animations": "10.2.5",
|
22
|
+
"@angular/common": "10.2.5",
|
23
|
+
"@angular/compiler": "10.2.5",
|
24
|
+
"@angular/core": "10.2.5",
|
25
|
+
"@angular/forms": "10.2.5",
|
26
|
+
"@angular/platform-browser": "10.2.5",
|
27
|
+
"@angular/platform-browser-dynamic": "10.2.5",
|
28
|
+
"@angular/router": "10.2.5",
|
29
|
+
"@angular/service-worker": "10.2.5",
|
30
30
|
"@babel/runtime": "^7.14.8",
|
31
31
|
"@ionic-native/app-version": "4.10.0",
|
32
32
|
"@ionic-native/barcode-scanner": "4.10.0",
|
@@ -68,15 +68,16 @@
|
|
68
68
|
"tslib": "^2.0.0",
|
69
69
|
"x2js": "3.2.6",
|
70
70
|
"zone.js": "~0.10.3",
|
71
|
-
"@wavemaker/app-ng-runtime": "
|
71
|
+
"@wavemaker/app-ng-runtime": "11.0.0-next.139409"
|
72
72
|
},
|
73
73
|
"devDependencies": {
|
74
74
|
"@ampproject/rollup-plugin-closure-compiler": "0.8.5",
|
75
|
-
"@angular-builders/custom-webpack": "
|
76
|
-
"@angular-devkit/build-angular": "0.
|
77
|
-
"@angular/
|
78
|
-
"@angular/
|
79
|
-
"@angular/
|
75
|
+
"@angular-builders/custom-webpack": "9.2.0",
|
76
|
+
"@angular-devkit/build-angular": "0.1002.3",
|
77
|
+
"@angular-devkit/build-ng-packagr": "0.1002.3",
|
78
|
+
"@angular/cli": "10.2.3",
|
79
|
+
"@angular/compiler-cli": "10.2.5",
|
80
|
+
"@angular/language-service": "10.2.5",
|
80
81
|
"@babel/plugin-transform-runtime": "^7.14.5",
|
81
82
|
"@compodoc/compodoc": "1.1.11",
|
82
83
|
"@types/jasmine": "2.8.8",
|
@@ -102,7 +103,7 @@
|
|
102
103
|
"karma-jasmine-html-reporter": "^1.5.0",
|
103
104
|
"karma-mocha-reporter": "2.2.5",
|
104
105
|
"moment": "2.24.0",
|
105
|
-
"ng-packagr": "
|
106
|
+
"ng-packagr": "^10.1.2",
|
106
107
|
"npm-run-all": "4.1.5",
|
107
108
|
"rimraf": "2.6.3",
|
108
109
|
"rollup": "0.65.2",
|
@@ -113,7 +114,7 @@
|
|
113
114
|
"rollup-plugin-node-resolve": "3.4.0",
|
114
115
|
"ts-node": "7.0.1",
|
115
116
|
"tslint": "~6.1.0",
|
116
|
-
"typescript": "
|
117
|
+
"typescript": "3.9.10",
|
117
118
|
"util": "0.11.1"
|
118
119
|
}
|
119
120
|
}
|
@@ -1,44 +1,55 @@
|
|
1
1
|
import {
|
2
2
|
Injectable,
|
3
|
+
NgModuleFactoryLoader,
|
3
4
|
NgModuleRef,
|
4
5
|
Type,
|
5
6
|
Injector,
|
7
|
+
SystemJsNgModuleLoader,
|
8
|
+
Inject,
|
9
|
+
NgModuleFactory
|
6
10
|
} from '@angular/core';
|
7
11
|
import { PartialRefProvider } from '@wm/core';
|
8
12
|
import { ComponentType } from '@wm/runtime/base';
|
9
|
-
|
13
|
+
|
10
14
|
|
11
15
|
type ModuleWithRoot = Type<any> & { rootComponent: Type<any> };
|
12
|
-
type Options = {
|
13
|
-
prefab: string
|
14
|
-
};
|
15
16
|
|
16
17
|
@Injectable({
|
17
18
|
providedIn: 'root'
|
18
19
|
})
|
19
20
|
export class LazyComponentRefProviderService extends PartialRefProvider {
|
20
21
|
private moduleRef: NgModuleRef<any>;
|
21
|
-
|
22
|
-
|
22
|
+
constructor(
|
23
|
+
@Inject(NgModuleFactoryLoader) private loader: SystemJsNgModuleLoader,
|
24
|
+
private injector: Injector
|
25
|
+
) {
|
23
26
|
super();
|
24
27
|
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
private getModulePath(componentName: string, componentType: ComponentType, options?: any): string {
|
29
|
+
if (componentName.length > 0) {
|
30
|
+
if (componentType === ComponentType.PARTIAL && options && options.prefab) {
|
31
|
+
return `src/app/prefabs/${options.prefab}/partials/${componentName}/${componentName}.module#${componentName
|
32
|
+
.charAt(0)
|
33
|
+
.toUpperCase()}${componentName.slice(1)}Module`;
|
34
|
+
}
|
35
|
+
if (componentType === ComponentType.PARTIAL) {
|
36
|
+
return `src/app/partials/${componentName}/${componentName}.module#${componentName
|
37
|
+
.charAt(0)
|
38
|
+
.toUpperCase()}${componentName.slice(1)}Module`;
|
39
|
+
} else if (componentType === ComponentType.PREFAB) {
|
40
|
+
return `src/app/prefabs/${componentName}/${componentName}.module#${componentName
|
41
|
+
.charAt(0)
|
42
|
+
.toUpperCase()}${componentName.slice(1)}Module`;
|
43
|
+
}
|
35
44
|
}
|
45
|
+
return null;
|
36
46
|
}
|
37
|
-
|
38
|
-
|
47
|
+
public async getComponentFactoryRef(componentName: string, componentType: ComponentType, options?: {}) {
|
48
|
+
let moduleFactory: NgModuleFactory<any>;
|
39
49
|
try {
|
40
|
-
|
41
|
-
|
50
|
+
moduleFactory = await this.loader.load(
|
51
|
+
this.getModulePath(componentName, componentType, options)
|
52
|
+
);
|
42
53
|
this.moduleRef = moduleFactory.create(this.injector);
|
43
54
|
const rootComponent = (moduleFactory.moduleType as ModuleWithRoot)
|
44
55
|
.rootComponent;
|