angular-module
v1.0.1
Published
ES6 way to define Angular 1.x modules and register services, factories, etc. as ES6 classes.
Downloads
71
Maintainers
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.js
import AngularModule from 'angular-module';
export default new AngularModule('api', [
]);
// auth.js
import AngularModule from 'angular-module';
export default new AngularModule('auth', [
]);
License
MIT