Dotie
tiny, powerful dependency injection container for node and browser inspired on angularJS
Instalation
The installation of this package is very simple: In fact, it can be installed by just running:
$ npm install dotie # if using NodeJS $ bower install dotie # if you want to use this package in the browser
Reference
API
/** * create an new dependency into container * @param * @param * @returns */dotie.registername, provider /* or */ dotie.<name> = provider /** * find and resolve dependencies and return then * @param * @returns */dotie.resolvename /* or */ dotie.<name>
Example
// small sintaxdotie.q =$.Deferred // dotie.<name> = dependence // default sintaxdotie.register'http', // using angular injection style (option 1)dotie.register'user', // angular injection style (option 2) controller.$inject = dotie.register'controller', controller /* or */ dotie.controller = controller