Saturday, January 4, 2014

using require.js to slurp something else in outside of AMD signatures

var fooCtrl = require(["controllers/fooCtrl"]);
var barCtrl = require(["controllers/barCtrl"]);

 
 

...midstream in the app.js for an AngularJS implementation may be superior to bringing in "controllers/fooCtrl" and "controllers/barCtrl" at the AMD signature, especially so if the controllers need to use an Angular module defined partway into app.js.* I am struggling to try to take an Angular project full of script tags and migrate it to one which uses an AMD pattern and there is some pain. I used the trick here to get past (I think) one problem, but now I've just hit another.

*The pain... Uncaught Error: [$injector:nomod]

No comments:

Post a Comment