How to add medic-injector to node.js app

I've installed the medic-injector package and created an app/bootstrap.js file per the instructions found on medic-injector's github site at https://github.com/DrBenton/Medic-Injector-JS

How do we make sure the injectors are called once my app.js is fired up? Anyone have any pointers?

Thanks in advance!

Tami

After you create your injector and add mappings, you need to call the "triggerFunctionWithInjectedParams" method on your injector.

For example:

injector.triggerFunctionWithInjectedParams([function name that you want to call]);

See the api documentation for the injector class to see what methods it contains: http://drbenton.github.com/Medic-Injector-JS/api/#!/api/sync.Injector

The basic usage of medic-injector is:

  1. create an injector object
  2. add mappings to injector
  3. (remove mappings if desired, if mutating the injector)
  4. use triggerFunctionWithInjectedParams to call the function with all of the mappings injected.