angular-module

ES2015 way to define Angular 1x modules and register services, factories, etc. as ES2015 classes

Showing:

Popularity

Downloads/wk

21

GitHub Stars

3

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

5

Size (min+gzip)

0.6KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

angular-module

ES2015 way to define Angular 1x modules and register services, factories, etc. as ES2015 classes

This project module was mainly inspired by register.js

Installation

npm install --save angular-module

Usage

// app.js
import AngularModule from 'angular-module';
import * as config from './config';
import {AppCtrl} from './AppCtrl';

new AngularModule('app', [

  // add your dependency modules here

])
.config(config.routing)
.config(config.foo)
.config(config.bar)
.controller('AppCtrl', AppCtrl);

Nested modules

/src
    /app.js
    /api/module.js
    /auth/module.js
// app.js
import AngularModule from 'angular-module';
import api from './api/module';
import auth from './auth/module';

new AngularModule('app', [
  api,
  auth
]);
// /api/module.js
import AngularModule from 'angular-module';

export default new AngularModule('api', [

]);
// /auth/module.js
import AngularModule from 'angular-module';

export default new AngularModule('auth', [

]);

How To Define Classes

Please feel free to have a look at https://github.com/michaelbromley/angular-es6 to see how Angular 1.x components can be defined as ES6 classes.

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100