项目作者: shikaan

项目描述 :
Yet another component generator for AngularJS <= 1.4
高级语言: JavaScript
项目地址: git://github.com/shikaan/ng1-component-generator.git
创建时间: 2017-08-06T16:07:47Z
项目社区:https://github.com/shikaan/ng1-component-generator

开源协议:

下载


ng1-component-generator

Yet another component generator for AngularJS <= 1.4

Installation and usage

Installation:

  1. npm install -g ng1-component-generator

Usage:

  1. Usage: ng1-component-generator [options] <component>
  2. Options:
  3. -V, --version output the version number
  4. -p, --path [value] Destination path [./src/app]
  5. -t, --tests Add specs file?
  6. -m, --module [value] Angular module name [app]
  7. -h, --help output usage information

What does this do?

This module quickly scaffolds an AngularJS component with template, controller
and tests.

Why?

I have to deal with some legacy code on daily basis, so I found useful
to create a generator for my particular needs.

This lighten the weight of doing repetitve tasks and write boilerplate code.

Actually in AngularJS <= 1.4 you don’t have components. This module ease the
migration to new AngularJS version by using the same naming convention adopted
in newer Angular.

Example

Launching

  1. ng1-component-generator -p ./example/app -m app -t header

Will create the following

  1. example
  2. └── app
  3. └── header
  4. ├── header.component.js
  5. ├── header.controller.js
  6. ├── header.controller.specs.js
  7. └── header.template.html

the content of which is directly available from this repo.

Contributing

There are no tests and a lot of feature can be added. Here’s a quick list:

  • service/factory/providers scaffolding;
  • module scaffolding;
  • directives scaffolding;

Any contribution will be apreciated.