Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

generator-ng-module

0.1.6 • Public • Published

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

install

npm i generator-ng-module

Downloadsweekly downloads

1

version

0.1.6

license

none

repository

githubgithub

last publish

collaborators

  • avatar