Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including generator-ng-module with all npm packages installed. Try it out:

require("yo/package.json"); // yo is a peer dependency. var generatorNgModule = require("generator-ng-module")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

generator-ng-module v0.1.6

A generator for Yeoman

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

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free