generator-ct-ng2
v1.0.2
Published
Yeoman generator
Downloads
5
Keywords
Readme
#generator-centeva-angular
Yeoman Generator for Centeva Angular 2 Projects (http://http://www.centeva.com/)
Prerequisites: Node, Grunt, Yeoman, and Bower. Once Node is installed, do:
npm install -g grunt-cli yo bower
Next, install this generator:
npm install -g generator-ct-ng2
To create a project:
mkdir MyNewAwesomeApp
cd MyNewAwesomeApp
yo centeva-angular
Grunt Tasks
Now that the project is created, you have 3 simple Grunt commands available:
grunt serve #This will run a development server with watch & livereload enabled.
grunt test #Run local unit tests.
grunt build #Places a fully optimized (minified, concatenated, and more) in /dist
When grunt serve
is running, any changed javascript files will be linted using JSHint as well as have their appropriate unit tests executed. Only the unit tests that correspond to the changed file will be run. This allows for an efficient test driven workflow.
Yeoman Subgenerators
There are a set of subgenerators to initialize empty Angular components. Each of these generators will:
- Create one or more skeleton files (javascript, LESS, html, spec etc) for the component type.
- Update any necessary files
There are generators for directive
,partial
,service
, filter
, module
, and modal
.
Running a generator:
yo ct-ng2:directive my-awesome-directive
yo ct-ng2:component my-component
yo ct-ng2:service my-service
yo ct-ng2:pipe my-pipe
yo ct-ng2:class my-class
yo ct-ng2:interface my-interface
yo ct-ng2:enum my-enum
The name paramater passed (i.e. 'my-awesome-directive') will be used as the file names. The generators will derive appropriate class names from this parameter (ex. 'my-awesome-directive' will convert to a class name of 'MyAwesomeDirective'). Each sub-generator will ask for the folder in which to create the new skeleton files. You may override the default folder for each sub-generator in the .yo-rc.json
file.