@coolon/angular-ui-powerups 0.0.27 → 0.0.28
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/coolon-angular-ui-powerups.umd.js +5 -1
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +2 -2
- package/esm2015/lib/place/route/parameter-decorators.js +5 -1
- package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +2 -2
- package/esm5/lib/place/route/parameter-decorators.js +5 -1
- package/fesm2015/coolon-angular-ui-powerups.js +5 -1
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +5 -1
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/place/route/parameter-decorators.d.ts +2 -0
- package/package.json +1 -1
- package/schematics/place-routes/place-def.d.ts +7 -4
- package/schematics/place-routes/place-def.js +41 -17
- package/schematics/place-routes/place-def.js.map +1 -1
- package/schematics/place-routes/scanner.d.ts +14 -2
- package/schematics/place-routes/scanner.js +57 -13
- package/schematics/place-routes/scanner.js.map +1 -1
- package/schematics/place-routes/templates/{services/place-router.service.ts.template → place-router.ts.template} +13 -18
|
@@ -9,27 +9,53 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
const src_1 = require("@typescript-plus/fast-memoize-decorator/dist/src");
|
|
10
10
|
const scanner_1 = require("./scanner");
|
|
11
11
|
class PlaceDef {
|
|
12
|
-
constructor(importPath, componentClass, properties, routeDef,
|
|
12
|
+
constructor(importPath, componentClass, properties, routeDef, routeParameters) {
|
|
13
13
|
this.importPath = importPath;
|
|
14
14
|
this.componentClass = componentClass;
|
|
15
15
|
this.properties = properties;
|
|
16
16
|
this.routeDef = routeDef;
|
|
17
|
-
this.
|
|
18
|
-
// console.log({ properties, routeDef });
|
|
17
|
+
this.routeParameters = routeParameters;
|
|
19
18
|
}
|
|
20
19
|
get path() {
|
|
21
|
-
return
|
|
20
|
+
return PlaceDef.stripEnclosingQuotes(this.properties.path);
|
|
22
21
|
}
|
|
23
22
|
get routeIdentifier() {
|
|
24
|
-
return this.routeDef
|
|
23
|
+
return this.routeDef;
|
|
25
24
|
}
|
|
26
25
|
get fullPath() {
|
|
27
26
|
return !!this.routeIdentifier ?
|
|
28
|
-
`${this.path}/:${this.routeIdentifier}` :
|
|
27
|
+
`${this.path}/:${this.routeIdentifier.parameterName}` :
|
|
29
28
|
this.path;
|
|
30
29
|
}
|
|
30
|
+
getPlaceRouterGoArgs() {
|
|
31
|
+
const bits = [];
|
|
32
|
+
if (this.routeIdentifier) {
|
|
33
|
+
bits.push(`${this.routeIdentifier.modelName}:${this.routeIdentifier.typeName}`);
|
|
34
|
+
}
|
|
35
|
+
if (this.routeParameters && this.routeParameters.length > 0) {
|
|
36
|
+
const properties = this.routeParameters.map(p => `${p.parameterName}?: ${p.typeName}`);
|
|
37
|
+
bits.push(`routeParameters?: { ${properties.join(', ')} }`);
|
|
38
|
+
}
|
|
39
|
+
return bits.join(', ');
|
|
40
|
+
}
|
|
41
|
+
getPlaceRouterGoRouteParams() {
|
|
42
|
+
const bits = [`"${this.path}"`];
|
|
43
|
+
if (this.routeIdentifier) {
|
|
44
|
+
bits.push(`${this.routeIdentifier.modelName}`);
|
|
45
|
+
}
|
|
46
|
+
if (this.routeParameters && this.routeParameters.length > 0) {
|
|
47
|
+
const mandatory = bits.join(', ');
|
|
48
|
+
bits.push(`routeParameters`);
|
|
49
|
+
const all = bits.join(', ');
|
|
50
|
+
return `routeParameters ? [${all}] : [${mandatory}]`;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return `[${bits.join(', ')}]`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
31
56
|
get placeName() {
|
|
32
|
-
|
|
57
|
+
const s = this.componentClass.replace(/Component$/, 'Place');
|
|
58
|
+
return s.charAt(0).toLowerCase() + s.slice(1);
|
|
33
59
|
}
|
|
34
60
|
get order() {
|
|
35
61
|
return this.properties.order;
|
|
@@ -45,26 +71,18 @@ class PlaceDef {
|
|
|
45
71
|
return activateGuards;
|
|
46
72
|
}
|
|
47
73
|
requiresRouteGuard() {
|
|
48
|
-
return this.routeIdentifier || this.
|
|
74
|
+
return this.routeIdentifier || this.routeParameters.length > 0;
|
|
49
75
|
}
|
|
50
76
|
get routeModelName() {
|
|
51
|
-
return this.routeDef ? this.
|
|
77
|
+
return this.routeDef ? this.routeDef.modelName : null;
|
|
52
78
|
}
|
|
53
79
|
get authenticate() {
|
|
54
80
|
return this.properties.authenticate === 'true';
|
|
55
81
|
}
|
|
56
|
-
stripEnclosingQuotes(value) {
|
|
57
|
-
const cooked = value.replace(/(^["'])|(["']$)/g, '');
|
|
58
|
-
// console.log({ raw: value, cooked: cooked });
|
|
59
|
-
return cooked;
|
|
60
|
-
}
|
|
61
82
|
}
|
|
62
83
|
__decorate([
|
|
63
84
|
src_1.Memoize()
|
|
64
85
|
], PlaceDef.prototype, "path", null);
|
|
65
|
-
__decorate([
|
|
66
|
-
src_1.Memoize()
|
|
67
|
-
], PlaceDef.prototype, "routeIdentifier", null);
|
|
68
86
|
__decorate([
|
|
69
87
|
src_1.Memoize()
|
|
70
88
|
], PlaceDef.prototype, "placeName", null);
|
|
@@ -80,5 +98,11 @@ exports.PlaceDef = PlaceDef;
|
|
|
80
98
|
return new scanner_1.Scanner(classDecl, context);
|
|
81
99
|
}
|
|
82
100
|
PlaceDef.scan = scan;
|
|
101
|
+
function stripEnclosingQuotes(value) {
|
|
102
|
+
const cooked = value.replace(/(^["'])|(["']$)/g, '');
|
|
103
|
+
// console.log({ raw: value, cooked: cooked });
|
|
104
|
+
return cooked;
|
|
105
|
+
}
|
|
106
|
+
PlaceDef.stripEnclosingQuotes = stripEnclosingQuotes;
|
|
83
107
|
})(PlaceDef = exports.PlaceDef || (exports.PlaceDef = {}));
|
|
84
108
|
//# sourceMappingURL=place-def.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-def.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/place-def.ts"],"names":[],"mappings":";;;;;;;;AACA,0EAA2E;AAE3E,uCAAoC;AAEpC,MAAa,QAAQ;IAGnB,YACW,UAAkB,EAClB,cAAsB,EACtB,UAA4B,EAC5B,QAA4B,EAC5B,eAAqC;QAJrC,eAAU,GAAV,UAAU,CAAQ;QAClB,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAkB;QAC5B,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,oBAAe,GAAf,eAAe,CAAsB;
|
|
1
|
+
{"version":3,"file":"place-def.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/place-def.ts"],"names":[],"mappings":";;;;;;;;AACA,0EAA2E;AAE3E,uCAAoC;AAEpC,MAAa,QAAQ;IAGnB,YACW,UAAkB,EAClB,cAAsB,EACtB,UAA4B,EAC5B,QAA4B,EAC5B,eAAqC;QAJrC,eAAU,GAAV,UAAU,CAAQ;QAClB,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAkB;QAC5B,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,oBAAe,GAAf,eAAe,CAAsB;IAEhD,CAAC;IAGD,IAAI,IAAI;QACN,OAAO,QAAQ,CAAC,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YAC7B,GAAG,IAAI,CAAC,IAAI,KA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B,EAAE,OAAyB;QACzE,OAAO,IAAI,iBAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAFe,aAAI,OAEnB,CAAA;IAED,SAAgB,oBAAoB,CAAC,KAAa;QAChD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QACrD,+CAA+C;QAC/C,OAAO,MAAM,CAAC;IAChB,CAAC;IAJe,6BAAoB,uBAInC,CAAA;AAGH,CAAC,EA1BgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QA0BxB"}
|
|
@@ -10,8 +10,10 @@ export declare class Scanner {
|
|
|
10
10
|
onMatch(callback: (scan: Scanner) => void): void;
|
|
11
11
|
createDefinition(moduleImportPath: string): PlaceDef;
|
|
12
12
|
protected getPlaceOptions(): PlaceDef.Options;
|
|
13
|
-
protected getRouteIdParameter():
|
|
14
|
-
protected
|
|
13
|
+
protected getRouteIdParameter(): Scanner.RouteParameterInfo;
|
|
14
|
+
protected getRouteParameters(): PlaceDef.Parameter[];
|
|
15
|
+
private getValueModelRouteProperties;
|
|
16
|
+
private getListModelRouteProperties;
|
|
15
17
|
protected getDecoratedProperties(annotation: string): {
|
|
16
18
|
decorator: Decorator;
|
|
17
19
|
property: PropertyDeclaration;
|
|
@@ -23,4 +25,14 @@ export declare namespace Scanner {
|
|
|
23
25
|
position: number;
|
|
24
26
|
required: boolean;
|
|
25
27
|
}): T;
|
|
28
|
+
class RouteParameterInfo implements PlaceDef.Parameter {
|
|
29
|
+
private readonly as;
|
|
30
|
+
readonly property: PropertyDeclaration;
|
|
31
|
+
readonly isArray: boolean;
|
|
32
|
+
readonly baseTypeName: string;
|
|
33
|
+
constructor(as: string, property: PropertyDeclaration);
|
|
34
|
+
readonly parameterName: string;
|
|
35
|
+
readonly modelName: string;
|
|
36
|
+
readonly typeName: string;
|
|
37
|
+
}
|
|
26
38
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const src_1 = require("@typescript-plus/fast-memoize-decorator/dist/src");
|
|
3
10
|
const ts_morph_1 = require("ts-morph");
|
|
4
11
|
const place_def_1 = require("./place-def");
|
|
5
12
|
function isDecoratorNode(node, name) {
|
|
6
13
|
return node.getKind() === ts_morph_1.SyntaxKind.Decorator && node.getText().startsWith(`${name}(`); // NOTE: I'm only supporting the @Decorator(...) style of usage (i.e. decorator factories).
|
|
7
14
|
}
|
|
15
|
+
const ROUTE_PROPERTY_REGEX = /.*(ListModel|ValueModel)<(.*)>/;
|
|
8
16
|
class Scanner {
|
|
9
17
|
constructor(classDecl, context) {
|
|
10
18
|
this.classDecl = classDecl;
|
|
@@ -27,7 +35,7 @@ class Scanner {
|
|
|
27
35
|
}
|
|
28
36
|
createDefinition(moduleImportPath) {
|
|
29
37
|
this.getRouteIdParameter();
|
|
30
|
-
return new place_def_1.PlaceDef(moduleImportPath, this.classDecl.getName(), this.getPlaceOptions(), this.getRouteIdParameter(), this.
|
|
38
|
+
return new place_def_1.PlaceDef(moduleImportPath, this.classDecl.getName(), this.getPlaceOptions(), this.getRouteIdParameter(), this.getRouteParameters());
|
|
31
39
|
}
|
|
32
40
|
getPlaceOptions() {
|
|
33
41
|
// const args = this.placeAnnotation.getArguments();
|
|
@@ -48,31 +56,38 @@ class Scanner {
|
|
|
48
56
|
const routeProperties = this.getDecoratedProperties('@RouteId');
|
|
49
57
|
if (routeProperties.length === 1) {
|
|
50
58
|
const route = routeProperties[0];
|
|
51
|
-
const routeOptions = Scanner.getOptionsArg(route.decorator, { as: '
|
|
59
|
+
const routeOptions = Scanner.getOptionsArg(route.decorator, { as: '' }, {
|
|
52
60
|
position: 1,
|
|
53
61
|
required: false
|
|
54
62
|
});
|
|
55
|
-
return
|
|
56
|
-
modelName: route.property.getName(),
|
|
57
|
-
parameterName: routeOptions.as
|
|
58
|
-
};
|
|
63
|
+
return new Scanner.RouteParameterInfo(routeOptions.as, route.property);
|
|
59
64
|
}
|
|
60
65
|
else if (routeProperties.length > 1) {
|
|
61
66
|
this.context.logger.error(`There an only be one @RouteId(), got ${routeProperties.length}`);
|
|
62
67
|
}
|
|
63
68
|
return null;
|
|
64
69
|
}
|
|
65
|
-
|
|
66
|
-
return this.
|
|
70
|
+
getRouteParameters() {
|
|
71
|
+
return this.getValueModelRouteProperties().concat(this.getListModelRouteProperties());
|
|
72
|
+
}
|
|
73
|
+
getValueModelRouteProperties() {
|
|
74
|
+
return this.getDecoratedProperties('@RouteParameter')
|
|
75
|
+
.map(p => {
|
|
76
|
+
const routeOptions = Scanner.getOptionsArg(p.decorator, { as: p.property.getName() }, {
|
|
77
|
+
position: 1,
|
|
78
|
+
required: false
|
|
79
|
+
});
|
|
80
|
+
return new Scanner.RouteParameterInfo(routeOptions.as, p.property);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
getListModelRouteProperties() {
|
|
84
|
+
return this.getDecoratedProperties('@RouteParameterList')
|
|
67
85
|
.map(p => {
|
|
68
|
-
const
|
|
86
|
+
const routeOptions = Scanner.getOptionsArg(p.decorator, { as: p.property.getName() }, {
|
|
69
87
|
position: 1,
|
|
70
88
|
required: false
|
|
71
89
|
});
|
|
72
|
-
return
|
|
73
|
-
modelName: p.property.getName(),
|
|
74
|
-
parameterName: options.as
|
|
75
|
-
};
|
|
90
|
+
return new Scanner.RouteParameterInfo(routeOptions.as, p.property);
|
|
76
91
|
});
|
|
77
92
|
}
|
|
78
93
|
getDecoratedProperties(annotation) {
|
|
@@ -121,5 +136,34 @@ exports.Scanner = Scanner;
|
|
|
121
136
|
}
|
|
122
137
|
}
|
|
123
138
|
Scanner.getOptionsArg = getOptionsArg;
|
|
139
|
+
class RouteParameterInfo {
|
|
140
|
+
constructor(as, property) {
|
|
141
|
+
this.as = as;
|
|
142
|
+
this.property = property;
|
|
143
|
+
const type = property.getStructure().type;
|
|
144
|
+
const match = ROUTE_PROPERTY_REGEX.exec(type);
|
|
145
|
+
if (!match) {
|
|
146
|
+
throw new Error(`expected ${property.getName()} to be a ListModel or ValueModel, got: ${type}`);
|
|
147
|
+
}
|
|
148
|
+
this.isArray = match[1] === 'ListModel';
|
|
149
|
+
this.baseTypeName = match[2];
|
|
150
|
+
}
|
|
151
|
+
get parameterName() {
|
|
152
|
+
return this.as.length > 0 ? place_def_1.PlaceDef.stripEnclosingQuotes(this.as) : this.modelName;
|
|
153
|
+
}
|
|
154
|
+
get modelName() {
|
|
155
|
+
return place_def_1.PlaceDef.stripEnclosingQuotes(this.property.getName());
|
|
156
|
+
}
|
|
157
|
+
get typeName() {
|
|
158
|
+
return this.isArray ? `${this.baseTypeName}[]` : this.baseTypeName;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
__decorate([
|
|
162
|
+
src_1.Memoize()
|
|
163
|
+
], RouteParameterInfo.prototype, "parameterName", null);
|
|
164
|
+
__decorate([
|
|
165
|
+
src_1.Memoize()
|
|
166
|
+
], RouteParameterInfo.prototype, "modelName", null);
|
|
167
|
+
Scanner.RouteParameterInfo = RouteParameterInfo;
|
|
124
168
|
})(Scanner = exports.Scanner || (exports.Scanner = {}));
|
|
125
169
|
//# sourceMappingURL=scanner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/scanner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scanner.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/scanner.ts"],"names":[],"mappings":";;;;;;;;AACA,0EAA2E;AAC3E,uCAQkB;AAClB,2CAAuC;AAEvC,SAAS,eAAe,CAAC,IAAU,EAAE,IAAY;IAC/C,OAAO,IAAI,CAAC,OAAO,EAAE,KAAK,qBAAU,CAAC,SAAS,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,2FAA2F;AACtL,CAAC;AAED,MAAM,oBAAoB,GAAG,gCAAgC,CAAC;AAE9D,MAAa,OAAO;IAIlB,YAA6B,SAA2B,EAAW,OAAyB;QAA/D,cAAS,GAAT,SAAS,CAAkB;QAAW,YAAO,GAAP,OAAO,CAAkB;QAC1F,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9B,IAAI,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE;gBACnC,IAAI,CAAC,eAAe,GAAG,IAAiB,CAAC;gBACzC,sDAAsD;gBACtD,OAAO,IAAI,CAAC;aACb;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,OAAO,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,OAAO,CAAC,QAAiC;QACvC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;YAClB,QAAQ,CAAC,IAAI,CAAC,CAAC;SAChB;IACH,CAAC;IAED,gBAAgB,CAAC,gBAAwB;QACvC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,IAAI,oBAAQ,CAAC,gBAAgB,EAClC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,EACxB,IAAI,CAAC,eAAe,EAAE,EACtB,IAAI,CAAC,mBAAmB,EAAE,EAC1B,IAAI,CAAC,kBAAkB,EAAE,CAC1B,CA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E,GAAF,EAAE,CAAQ;YAAW,aAAQ,GAAR,QAAQ,CAAqB;YAC7E,MAAM,IAAI,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAc,CAAC;YACpD,MAAM,KAAK,GAAG,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9C,IAAI,CAAC,KAAK,EAAE;gBACV,MAAM,IAAI,KAAK,CAAC,YAAY,QAAQ,CAAC,OAAO,EAAE,0CAA0C,IAAI,EAAE,CAAC,CAAC;aACjG;YACD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC;YACxC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC;QAGD,IAAI,aAAa;YACf,OAAO,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAQ,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;QACtF,CAAC;QAGD,IAAI,SAAS;YACX,OAAO,oBAAQ,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;QAChE,CAAC;QAED,IAAI,QAAQ;YACV,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;QACrE,CAAC;KACF;IAZC;QADC,aAAO,EAAE;2DAGT;IAGD;QADC,aAAO,EAAE;uDAGT;IAvBU,0BAAkB,qBA4B9B,CAAA;AACH,CAAC,EAzDgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAyDvB"}
|
|
@@ -12,27 +12,22 @@
|
|
|
12
12
|
import { Injectable } from '@angular/core';
|
|
13
13
|
import { Router } from '@angular/router';
|
|
14
14
|
|
|
15
|
-
<% placeDefs.forEach(def => { %>import {<%= def.componentClass %>} from "<%= def.importPath %>";
|
|
16
|
-
<% }); %>
|
|
17
|
-
|
|
18
15
|
@Injectable({
|
|
19
16
|
providedIn: 'root'
|
|
20
17
|
})
|
|
21
|
-
export class
|
|
18
|
+
export class PlaceRouter {
|
|
22
19
|
constructor(private readonly router:Router) {
|
|
23
20
|
}
|
|
24
|
-
}
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
//
|
|
22
|
+
<% placeDefs.forEach(def => { %>
|
|
23
|
+
get <%= def.placeName %>() {
|
|
24
|
+
const self = this;
|
|
25
|
+
return {
|
|
26
|
+
go(<%=def.getPlaceRouterGoArgs()%>) {
|
|
27
|
+
const params = <%=def.getPlaceRouterGoRouteParams()%>;
|
|
28
|
+
return self.router.navigate(params);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
<% }) %>
|
|
33
|
+
}
|