META-INF.dirigible.template-form-builder-angularjs.template.template.js Maven / Gradle / Ivy
The newest version!
/*
* Generated by Eclipse Dirigible based on model and template.
*
* Do not modify the content as it may be re-generated again.
*/
import * as generateUtils from "ide-generate-service/template/generateUtils";
export function generate(model, parameters) {
const templateModel = JSON.parse(model);
const templateSources = getTemplate(parameters).sources;
if (templateModel.code) {
templateModel.code = templateModel.code.split("\n").map(e => ` ${e}`).join('\n');
}
return generateUtils.generateGeneric(templateModel, parameters, templateSources);
};
export function getTemplate(parameters) {
return {
name: "AngularJS Generator from Form Model",
description: "AngularJS Form Model generator template",
extension: "form",
sources: [
{
location: "/template-form-builder-angularjs/ui/controller.js.template",
action: "generate",
rename: "gen/{{genFolderName}}/forms/{{fileName}}/controller.js",
engine: "velocity",
},
{
location: "/template-form-builder-angularjs/ui/index.html.template",
action: "generate",
rename: "gen/{{genFolderName}}/forms/{{fileName}}/index.html",
engine: "velocity",
},
{
location: "/template-form-builder-angularjs/ui/view.js.template",
action: "generate",
rename: "gen/{{genFolderName}}/forms/{{fileName}}/view.js",
engine: "velocity",
},
],
parameters: []
};
}