generator-ngbp-module

0.2.9 • Public • Published

generator-ngbp-module

tests dependencies Coverage Status npm version

Getting Started

Yeoman - Install prerequisites

To install yeoman and the ngbp-module generator from npm, run:

npm install -g yo generator-ngbp-module

Create a new Angular Project

If you are creating a project from the start - create a new directory, make it your current working directory and scaffold out your initial app using this generator or just use the following...

mkdir <appname> && cd $_
yo ngbp-module

which scaffolds out a complete angular app structure for you:

./
├── karma/
│   └── karma-unit.tpl.js
├── src/
│   ├── app/
│   │   ├── app.js
│   │   └── app.spec.js
│   ├── less/
│   │   ├── bootswatch.less
│   │   ├── main.less
│   │   ├── style.css
│   │   └── variables.less
│   └── index.html
├── .bowerrc
├── .editorconfig
├── .gitignore
├── .jshintrc
├── .yo-rc.json
├── CHANGELOG.md
├── Gruntfile.js
├── ProtractorConfig.js
├── README.md
├── bower.json
├── package.json
└── vendor.config.js

Pass --init as an option to force the initialization of a new app. This should be used with caution as this may overwrite existing files.

Use --banner=<bannerfile> to specify a file which contains the string to be used as a banner in scaffolded files. This string is stored as config variable banner in .yo-rc.json file in project root directory.

Create a new Angular Module

Create the module using...

yo ngbp-module example

which scaffolds out a complete angular module structure for you:

src/app/example/
├── assets/
├── controllers/
│   └── example.controllers.js
├── directives/
│   ├── partials/
│   └── example.directives.js
├── e2e/
│   └── example.e2e.js
├── filters/
│   └── example.filters.js
├── services/
│   └── example.services.js
├── styles/
│   └── example.less
├── unit/
│   └── example.spec.js
├── partials/
│   └── example.tpl.html
└── example.module.js

You can always reverse this by:

yo ngbp-module:remove example

Controllers

Create a module controller by:

yo ngbp-module:controller test

which creates the following files

 
src/app/example/
├── controllers/
│   └── TestCtrl.js
└── unit/
    └── TestCtrl.spec.js
    

and updates src/app/example/controllers/example.controllers.js to include the newly created Controller as a dependency

Directives

Create a module directive by:

yo ngbp-module:directive test

which creates the following files

 
src/app/example/
├── directives/
│   └── Test.js
└── unit/
    └── Test.directive.spec.js
    

and updates src/app/example/directives/example.directives.js to include the newly created Directive as a dependency

Services

Create a module service by:

yo ngbp-module:service test

which creates the following files

 
src/app/example/
├── services/
│   └── Test.js
└── unit/
    └── Test.service.spec.js
    

and updates src/app/example/services/example.services.js to include the newly created Service as a dependency

Filters

Create a module filter by:

yo ngbp-module:filter test

which creates the following files

 
src/app/example/
├── filters/
│   └── Test.js
└── unit/
    └── Test.filter.spec.js
    

and updates src/app/example/filters/example.filters.js to include the newly created Filter as a dependency

Roadmap

All features, improvements and bugs are being tracked on the Trello Board Ngbp-module.

License

Copyright (c) 2015 John Brennan - MIT license.

Readme

Keywords

Package Sidebar

Install

npm i generator-ngbp-module

Weekly Downloads

1

Version

0.2.9

License

MIT

Last publish

Collaborators

  • jfmbrennan