Created
October 11, 2013 00:58
-
-
Save beresmate/6928069 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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