angular-nevera-generator
Version:
Yeoman AngularJS scaffold a webapp with Angular 1 written in ES6 (Babel), TypeScript through Webpack or SystemJS including tools Gulp 4, ESLint, Browsersync and Karma
19 lines (17 loc) • 670 B
JavaScript
const fountain = require('fountain-generator');
module.exports = fountain.Base.extend({
writing() {
const name = this.options.name || 'service';
const titleCase = string => string.charAt(0).toUpperCase() + string.slice(1);
const path = this.options.dir ? `src/app/${this.options.dir}` : `src/app`;
const props = {
serviceName: titleCase(name),
modules: this.config.get('props').modules,
js: this.config.get('props').js,
framework: 'angular1',
name
};
this.copyTemplate(`src/app/service.js`, `${path}/${name}.js`, props);
this.copyTemplate(`src/app/service.spec.js`, `${path}/${name}.spec.js`, props);
}
});