Created
November 16, 2012 16:55
-
-
Save justinwinslow/4088942 to your computer and use it in GitHub Desktop.
Split module pattern
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
/* | |
DIRECTORY STRUCTURE | |
module1.js | |
module2.js | |
module2/ | |
- model.js | |
- view1.js | |
- view2.js | |
- template.js | |
*/ | |
/* MODULE 2 */ | |
define(['module2/model', 'module2/view1', 'module2/view2', 'module2/text!template'], function(model, view1, view2, template){ | |
var module2 = { | |
model: model, | |
view1: view1, | |
view2: view2, | |
template: template | |
} | |
return module2; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment