gen-ng-component
This micro-app generates an angularjs component according to John Papa's styleguide.
Installation
npm -g install gen-ng-component
Usage
gen-ng-component {moduleName} {componentName} {path}
Example
gen-ng-component app.main detailsList
^^ This line will generate the following files:
detailsList
├── detailsList.component.js
├── detailsList.controller.js
├── detailsList.html
└── detailsList.module.js
detailsList.component.js
(function() {
'use strict';
angular
.module('app.main.detailsList')
.component('detailsList', {
bindings: {
},
templateUrl: 'detailsList/detailsList.html',
controller: 'DetailsListController as vm',
});
})();
detailsList.controller.js
(function() {
'use strict';
angular
.module('app.main.detailsList')
.controller('DetailsListController', DetailsListController);
function DetailsListController() {
const vm = this;
}
})();
detailsList.html
<section class="details-list">
</section>
detailsList.module.js
(function() {
'use strict';
angular
.module('app.main.detailsList', []);
})();