0.1.6 • Published 11 years ago

generator-ng-module v0.1.6

Weekly downloads
5
License
-
Repository
github
Last release
11 years ago

generator-ng-module

A generator for Yeoman.

Description

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;
    });
})();

Getting Started

$ npm install -g yo

Installation

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

$ npm install -g generator-ng-module

Finally, initiate the generator:

$ yo ng-module

License

MIT License

0.1.6

11 years ago

0.1.5

12 years ago

0.1.4

12 years ago

0.1.3

12 years ago

0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago