https://github.com/skamenetskiy/gen-ng-component
A micro cli app to generate angularjs component according to John Papa's styleguide
https://github.com/skamenetskiy/gen-ng-component
angular angularjs cli component
Last synced: 2 months ago
JSON representation
A micro cli app to generate angularjs component according to John Papa's styleguide
- Host: GitHub
- URL: https://github.com/skamenetskiy/gen-ng-component
- Owner: skamenetskiy
- Created: 2017-11-01T12:49:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-01T13:17:30.000Z (over 8 years ago)
- Last Synced: 2025-05-24T08:42:08.460Z (about 1 year ago)
- Topics: angular, angularjs, cli, component
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gen-ng-component
[](https://travis-ci.org/skamenetskiy/gen-ng-component)
This micro-app generates an angularjs component according to John Papa's [styleguide](https://github.com/johnpapa/angular-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
```javascript
/**
* @desc detailsList component
* @namespace Components
*/
(function() {
'use strict';
angular
.module('app.main.detailsList')
.component('detailsList', {
bindings: {
},
templateUrl: 'detailsList/detailsList.html',
controller: 'DetailsListController as vm',
});
})();
```
detailsList.controller.js
```javascript
/**
* @desc detailsList component
* @namespace Controllers
*/
(function() {
'use strict';
angular
.module('app.main.detailsList')
.controller('DetailsListController', DetailsListController);
/**
* @name DetailsListController
* @desc detailsList controller
* @constructor
* @ngInject
*/
function DetailsListController() {
const vm = this;
}
})();
```
detailsList.html
```html
```
detailsList.module.js
```javascript
/**
* @desc detailsList component
* @namespace Modules
*/
(function() {
'use strict';
angular
.module('app.main.detailsList', []);
})();
```