Closed jsumners closed 10 years ago
I believe that your problem is this:
exports['@require'] = ['controllers/foo'];
exports['@singleton'] = true;
exports = module.exports = function(fooController) {
The last line is setting exports
, thus overwriting your annotations. Move the annotations below and it should work.
If you want to keep the @require
s near the factory function, you can do:
var dependencies = ['controllers/foo'];
exports = module.exports = function(fooController) {
//...
}
exports['@require'] = dependencies;
exports['@singleton'] = true;
Yep. That was it. Man I feel like a dunce. Thank you for the assistance.
Looking through the Express example, it seems as if Electrolyte will load scripts based on the names given in require annotations. I'm not finding this to be the case. Take a look at this repository -- https://github.com/jsumners/electrolyte-test
Should that repository work as-is? Because I'm getting the following error when I run it:
Or am I mistaken in my understanding of how Electrolyte works? Should be creating instances of my components prior to trying to use them as dependencies?