Hi guys,
I might be completely tired, but for some reason I can't get underscoreJS correctly plugged in LocomotiveJS...
did an 'npm install underscore'
in All.js : added "require('underscore');" at the top to make it look like this:
var express = require('express')
, poweredBy = require('connect-powered-by')
, util = require('util')
, _ = require('underscore');
Then required it again in the controller (same way).
I tried several options :
var __ = require('underscore');
var _ = require('underscore')._;
var underscore = require('underscore');
etc, etc, etc.
it does work correctly right after this : var MyCtrl = new Controller();
this displays the correct answer : console.log(" Testing _ : " + _.indexOf([1,2,3,4],4) );
But not inside any Controller ... for sure I need to make it available somehow, but don't know how.
Waiting for a little help on this :)
Thanks,
Frederic
PS: might be useful for other libraries to require later on ...