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

@ -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}}', {
templateUrl: './{{camelCase name}}.html',
controller: {{properCase name}}Controller,
});
export const {{camelCase name}} = {
templateUrl: './{{dashCase name}}.html',
controller,
};
angular.module('portainer.{{module}}').component('{{camelCase name}}', {{camelCase name}})

@ -25,12 +25,12 @@ module.exports = function (plop) {
},
{
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',
},
{
type: 'add',
path: `{{cwd}}/{{dashCase name}}/{{camelCase name}}.html`,
path: `{{cwd}}/{{dashCase name}}/{{dashCase name}}.html`,
templateFile: './plop-templates/component.html.hbs',
},
], // array of actions

Loading…
Cancel
Save