A generator for Yeoman.
- Make sure you have yo installed:
npm install -g yo
. - Install the generator:
npm install -g generator-angularjs
. - Make a new directory and
cd
into itmkdir myApp && cd $_
. - Run
yo angularjs
if you want a custom app name runyo angularjs myAwesomeApp
. - Run
grunt dev
to start developing andgrunt
for building.
Scaffolds a new AngularJS application, you will be prompted for some configuration params such as folder names, engines (CoffeeScript, Compass, Jade) and ngModules (angular-resource, restangular).
yo angularjs
Or
yo angularjs:myAwesomeApp
Generates a new controller in app/scripts/controllers/
. And adds it to your index (dot jade or dot html depending on your engines configuration).
yo angularjs:controller awesome
Generates a new view in app/templates/views/
.
yo angularjs:view awesomeView
Hooks for angularjs:controller
and angularjs:view
and add the new view to your app.coffee
or app.js
.
yo angularjs:route awesome
Note: if your route name is "main", the route will be .when('/', {})
.
Creates a new filter.
yo angularjs:filter reverse
This is a more interactive generator, when you fire it, it will prompt you which kind of service did you want to create (service, factory, provider, value or constant).
yo angularjs:service awesome
One of the features that makes this generator different than others, is the implementation of config/appConfig.json
file.
Is a folder in which you will have your application configuration, such as folders, your angular application module name, etc.
Everytime you run a generator, it would read your config/appConfig.json
file to figure out what engines are you using (CoffeeScript, Compass, Jade) and generate the appropriately file on the appropriately folder name.