Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COI created an app/bootstrap.js file exactly as outlined. I then included it in my app.js via "bootstrap = require('./app/bootstrap')". When I run "node app.js" an error is thrown inside of bootstrap.js on the line "var injector = new Injector()"...it is 'TypeError: object is not a function'. Obviously this means node.js exports cannot find it. I'm confused as to why this is not working. Obviously I'm not setting things up correctly, however, with other node packages setup/usage is usually trivial.
      singulars
    2. COOk, I looked closer at the API link you gave me and refactored my bootstrap.js so that the first two lines do the following: "var Injector = require('medic-injector').InjectorSync; var injector = new Injector()" It's not throwing any more errors...(I've been using Node.js for a week--newb me!). However, how to I call a method with injected params as well as non-injected params?
      singulars
    3. COYes, I did and the app threw up again. So this is my scenario: I have a method defined in another js file which I export via module.exports. It's called "sendAlertViewEmail(emails, message, callback, mailOptions, smtpTransport)". The following params should be injected: "mailOptions" and "smtpTransport". I call "sendAlertViewEmail" from another js file. Should I require('app/bootstrap') in the calling module and then use injector.triggerFunctionWithInjectedParams(sendAlertViaEmail) to actually call the method?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload