Created
May 9, 2013 23:52
-
-
Save rmurphey/5551495 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
require(['app'], function (App) { | |
App.init(); | |
}); | |
//app.js | |
define([ | |
'pages' | |
], function (pages) { | |
return { | |
init : function () { | |
var page = pages(); | |
page() | |
} | |
}; | |
}) | |
// | |
// pages.js | |
define([ | |
'pages/home', | |
'pages/static' | |
], function (home, static) { | |
return function () { | |
var pages = { | |
home : home, | |
static : static | |
}; | |
var page = $('body').attr('data-page'); | |
return pages[page]; | |
} | |
}) | |
// pages/home.js | |
define([], function () { | |
return function () { | |
$(document).ready(function () { | |
}); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment