Skip to content

Commit bbc8d81

Browse files
committed
Make properties in models to be generated before constructor
1 parent df61d45 commit bbc8d81

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

generators/templates/model.mst

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,28 @@ import { {{name}} } from "./{{fileName}}";
1818
*/
1919
{{/description}}
2020
export class {{name}}{{#supertype}} extends {{name}}{{/supertype}} {
21+
{{#properties}}
22+
{{#description}}
23+
/**
24+
* {{.}}
25+
*/
26+
{{/description}}
27+
public {{name}}: {{type}}{{#typeIsArray}}[]{{/typeIsArray}};
28+
{{^isLast}}
29+
30+
{{/isLast}}
31+
{{/properties}}
2132

2233
/**
2334
* Creates a {{name}}.
2435
*
2536
{{#supertype}}
2637
{{#properties}}
27-
* @param {{=<% %>=}}{<%type%>}<%={{ }}=%> {{name}} {{description}}
38+
* @param {{=<% %>=}}{<%type%>}<%={{ }}=%> {{name}}{{#description}} {{.}}{{/description}}
2839
{{/properties}}
2940
{{/supertype}}
3041
{{#properties}}
31-
* @param {{=<% %>=}}{<%type%>}<%={{ }}=%> {{name}} {{description}}
42+
* @param {{=<% %>=}}{<%type%>}<%={{ }}=%> {{name}}{{#description}} {{.}}{{/description}}
3243
{{/properties}}
3344
*/
3445
constructor({{#supertype}}{{#properties}}{{name}}: {{type}}{{#typeIsArray}}[]{{/typeIsArray}}, {{/properties}}{{/supertype}}{{#properties}}{{name}}: {{type}}{{#typeIsArray}}[]{{/typeIsArray}}{{^isLast}}, {{/isLast}}{{/properties}}) {
@@ -39,16 +50,4 @@ export class {{name}}{{#supertype}} extends {{name}}{{/supertype}} {
3950
this.{{name}} = {{name}};
4051
{{/properties}}
4152
}
42-
43-
{{#properties}}
44-
{{#description}}
45-
/**
46-
* {{.}}
47-
*/
48-
{{/description}}
49-
public {{name}}: {{type}}{{#typeIsArray}}[]{{/typeIsArray}};
50-
{{^isLast}}
51-
52-
{{/isLast}}
53-
{{/properties}}
5453
}

0 commit comments

Comments
 (0)