generator-ng-module

A generator for Yeoman

generator-ng-module

A generator for Yeoman.

A Yeoman generator for quickly getting (very opinionated) Angular modules going.

These modules utilize the following design pattern and are designed to be used with require.js. These modules also utilize ui.router, although that can easily be removed.

(function() {
    'use strict';
 
    var moduleName = 'fooModule',
 
        angularDependencies = [];
 
    define([
        'angular'
    ], function(angular) {
 
        var module = angular.module(moduleName, angularDependencies);
 
        module.config(['$stateProvider',
            function($stateProvider) {
 
                $stateProvider.state('foo', {
                    controller: 'fooCtrl',
                    url: '/foo',
                    templateUrl: 'path/to/foo/_foo.html'
                });
            }
        ]);
 
        module.controller('fooCtrl', ['$scope', '$state',
            function($scope$state) {
                // stuff 
            }
        ]);
 
        return module;
    });
})();
$ npm install -g yo

To install generator-ng-module from npm, run:

$ npm install -g generator-ng-module

Finally, initiate the generator:

$ yo ng-module

MIT License