Skip to content

Instantly share code, notes, and snippets.

@justinwinslow
Created November 16, 2012 16:55
Show Gist options
  • Save justinwinslow/4088942 to your computer and use it in GitHub Desktop.
Save justinwinslow/4088942 to your computer and use it in GitHub Desktop.
Split module pattern
/*
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