Skip to content

Instantly share code, notes, and snippets.

@beresmate
Created October 11, 2013 00:58
Show Gist options
  • Save beresmate/6928069 to your computer and use it in GitHub Desktop.
Save beresmate/6928069 to your computer and use it in GitHub Desktop.
var myApp = new Backbone.Marionette.Application();
var childModuleName = 'MainModule';
myApp.module(childModuleName, MainModule);
function MainModule (module, parent, Backbone, Marionette, $, _) {
var childModuleName = this.moduleName + '.foo';
this.app.module(childModuleName, Foo, childModuleName);
function Foo (module, parent, Backbone, Marionette, $, _, moduleName) {
var childModuleName = moduleName + '.bar';
this.app.module(childModuleName, Bar, childModuleName);
function Bar (module, parent, Backbone, Marionette, $, _, moduleName) {
console.log(moduleName); // prints Mainmodule.foo.bar
}
}
}
myApp.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment