2.1.4 • Published 8 years ago

generator-angular-nmi v2.1.4

Weekly downloads
12
License
GPL-3.0
Repository
github
Last release
8 years ago

Build Status Dependency Status Coverage Status

What this is (and isn't) about

  • It does generate various AngularJS resources (controllers, factories, routes, etc.) in a standard way, so that different developers of your project follow the same style.
  • It does not generate an AngularJS app scaffolding/structure for you. For this, you may use the excellent generator-gulp-angular.
  • It does follow a very opinionated style, mainly based on John Papa's excellent AngularJS styleguide. If you want different templates to apply your own team's styling, fork and replace the templates under templates folder.
  • It does not perform any kind of validation of your structure, conformance check to guidelines, linting, compression, merging, optimising, or anything of that sort.
  • Inspired by generator-ng-super.

Install

Install Yeoman:

npm install -g yo

Install generator:

npm install -g generator-angular-nmi

Internationalisation

All command-line output as well as all comments within the generated files can be customised by changing the lexicon file(s) under app/locales. The generator will automatically calculate the language to use based on your OS' language settings. In case a lexicon file is not available for your OS' locale, the default English one will be used.

Additional languages

Create a new JSON file under app/locales with the ISO 639 code of your locale. If you wish to contribute locales for another language please send a PR.

What is my current locale/language?

Locale/language discovery takes place using the os-locale library which practically looks into the value defined by any of env.LC_ALL, env.LC_MESSAGES, env.LANG,env.LANGUAGE (in that order).

Testing and coverage report

istanbul cover _mocha -- -R spec

Run

yo angular-nmi

Provides usage instructions.

Single-file generators

yo angular-nmi:constant

Generates: An AngularJS Constant.
Arguments: Output folder name, module name, constant name.
Template: constant.tpl.js

Examples
GeneratorGenerates fileModule's nameResource's name
yo angular-nmi:constant src/app module1 systemsrc/app/system.constant.jsmodule1SystemConstant

yo angular-nmi:controller

Generates: An AngularJS Controller.
Arguments: Output folder name, module name, controller name.
Template: controller.tpl.js

Examples
GeneratorGenerates fileModule's nameResource's name
yo angular-nmi:controller src/app module1 systemsrc/app/system.controller.jsmodule1SystemController

yo angular-nmi:factory

Generates: An AngularJS Factory.
Arguments: Output folder name, module name, factory/service name.
Template: factory.tpl.js

Examples
GeneratorGenerates fileModule's nameResource's name
yo angular-nmi:factory src/app module1 controlsrc/app/control.service.jsappControlService

yo angular-nmi:module

Generates: An AngularJS Module.
Arguments: Output folder name, module name, module filename.
Template: module.tpl.js

Examples
GeneratorGenerates fileModule's name
yo angular-nmi:module src/app/foo app.foo.suppliers supplierssrc/app/foo/suppliers.module.jsapp.foo.suppliers

yo angular-nmi:route-ui

Generates: An AngularJS Route configuration using AngularUI Router.
Arguments: Output folder name, module name, routes name.
Template: route-ui.tpl.js

Examples
GeneratorGenerates fileModule's name
yo angular-nmi:route-ui src/app module2 appsrc/app/app.route.jsmodule2

yo angular-nmi:view

Generates: An HTML view.
Arguments: Output folder name, view name.
Template: view.tpl.html

Examples
GeneratorGenerates file
yo angular-nmi:view src/app editsrc/app/edit.html

Group generators

yo angular-nmi:vc

Generates: A View and a Controller.
Arguments: Output folder name, module name, resources name.
Templates: view.tpl.html, controller.tpl.js

Examples
GeneratorGenerates fileModule's name
yo angular-nmi:vc src/app app exportsrc/app/export.html, src/app/export.controller.jsapp
2.1.4

8 years ago

2.1.3

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago