生成包含枚举(Configuration
)的实体(Status
)时,Angular模型如下所示:
const enum Status {
'DRAFT',
'DONE',
'ARCHIVED'
}
export class Configuration implements BaseEntity {
constructor(
public id?: number,
public json?: string,
public status?: EventConfigurationStatus,
) {
}
}
问题是枚举不会导出。因为我想自己使用枚举,所以我添加了export
关键字。这是_entity.model.ts
line 86
export
硬编码
您是否认为默认情况下export class JobBuilderOptimise extends React.Component<JobBuilderOptimiseProps & JobBuilderOptimiseDispatch> {
render() {
const {
jobPosting,
search,
previewByTemplate
} = this.props.pageState;
return (
<div className="optimise-page">
<Row>
<Col sm={7} >
<div className="optimise-panel">
{this.props.children}
</div>
</Col>
<Col sm={5}>
<div className="preview-panel">
<JobPostingControl jobDescription={jobPosting.data} isLoading={search.previewRequestState.isBusy || previewByTemplate.isBusy} leftSide={this.props.children}/>
</div>
</Col>
</Row>
</div>
);
}
会更好?
答案 0 :(得分:0)
是的,这是有道理的。
除了用例之外,如果您的Customer实体与Configuration有关系并使用"otherEntityField": "status"
,那么JHipster实体生成器也需要生成编译代码。