In the following plugin, the load method is correctly called, but the inner callback is never fired:
define("App/FooLoader", [], function() {
return {
load: function(id, require, callback) {
require(["App/Foo"], function(foo) {
callback(foo);
});
}
}
});
With the above, I was expecting that when included, like so:
// in Bar.js
require(['App/Fooloader!'], function(foo) { // do stuff with foo });
That:
App/FooLoaderis loaded, and theloadmethod is executedApp/Foois loaded, and the inner callback is executedApp/FooLoaderbody callback is executed withfoothe result of loadingApp/Foo.
However, only (1) happens, the callbacks (2) and (3) never happen. How come?
It works for me as below:
I created this JSFiddle to demonstrate: http://jsfiddle.net/fMR3Z/1/
Maybe you have an error in your file structure ?