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
cdinto itmkdir myApp && cd $_. - Run
yo angularjsif you want a custom app name runyo angularjs myAwesomeApp. - Run
grunt devto start developing andgruntfor 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 angularjsOr
yo angularjs:myAwesomeAppGenerates 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 awesomeGenerates a new view in app/templates/views/.
yo angularjs:view awesomeViewHooks for angularjs:controller and angularjs:view and add the new view to your app.coffee or app.js.
yo angularjs:route awesomeNote: if your route name is "main", the route will be .when('/', {}).
Creates a new filter.
yo angularjs:filter reverseThis 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 awesomeOne 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.
