Open aolde opened 10 years ago
Maybe something like this. It does add a hard dependency to other modules though, which is something I have tried to avoid.
// register loader as a dependency
var moduleObj = moduler('template-loader', ['loader'], {
init: function (module) {
// can call method on dependency module
module.loader.callSomeMethod();
}
})
Come up with a ways to enable reuse between modules.
Example a Template module uses the Loader module to receive data from server, and then adds template functionality to the response.
Ping @robertvs