chore(plop): use templates as in style guide (#4916)

* chore(plop): use templates as in style guide

fix [CE-483]

* chore(plop): export component and add to module
pull/4930/head^2
Chaim Lev-Ari 4 years ago committed by GitHub
parent 32a9a2e46b
commit d0d38990c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,4 +3,4 @@ class {{properCase name}}Controller {
constructor() {} constructor() {}
} }
export default {{properCase name}}Controller; export default {{properCase name}}Controller;

@ -1,6 +1,9 @@
import {{properCase name}}Controller from './{{dashCase name}}/{{camelCase name}}Controller.js' import angular from 'angular';
import controller from './{{dashCase name}}.controller.js'
angular.module('portainer.{{module}}').component('{{camelCase name}}', { export const {{camelCase name}} = {
templateUrl: './{{camelCase name}}.html', templateUrl: './{{dashCase name}}.html',
controller: {{properCase name}}Controller, controller,
}); };
angular.module('portainer.{{module}}').component('{{camelCase name}}', {{camelCase name}})

@ -25,12 +25,12 @@ module.exports = function (plop) {
}, },
{ {
type: 'add', type: 'add',
path: `{{cwd}}/{{dashCase name}}/{{camelCase name}}Controller.js`, path: `{{cwd}}/{{dashCase name}}/{{dashCase name}}.controller.js`,
templateFile: './plop-templates/component-controller.js.hbs', templateFile: './plop-templates/component-controller.js.hbs',
}, },
{ {
type: 'add', type: 'add',
path: `{{cwd}}/{{dashCase name}}/{{camelCase name}}.html`, path: `{{cwd}}/{{dashCase name}}/{{dashCase name}}.html`,
templateFile: './plop-templates/component.html.hbs', templateFile: './plop-templates/component.html.hbs',
}, },
], // array of actions ], // array of actions

Loading…
Cancel
Save