Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hugojosefson/require-all-for-angular-modules

Requires all *-for-angular modules, so we know they have all registered themselves to angular, without specifying each one separately.
https://github.com/hugojosefson/require-all-for-angular-modules

Last synced: 29 days ago
JSON representation

Requires all *-for-angular modules, so we know they have all registered themselves to angular, without specifying each one separately.

Awesome Lists containing this project

README

        

# require-all-for-angular-modules

Requires all `*-for-angular` modules, so we know they have all registered themselves to angular, without specifying each one separately.

This is useful when you have a bunch of AngularJS modules which adhere to these rules:

* packaged as a [component](https://github.com/component/component)
* registers its `angular.module` directly when the user does `require("that-module")`

(i.e. no exported function which the user is required to call)
* named `*-for-angular` to identify itself as adhering to these rules

## Installation

$ component install hugojosefson/require-all-for-angular-modules

## API

Call this after `` and ``, but before document ready:

require("require-all-for-angular-modules")();

Then you don't have to specify each module more than in your `component.json`'s dependencies and of course in each `angular.module` declaration's dependency array. No specific `` tag nor separate `require()` for each!

## License

MIT