Created
April 1, 2014 07:09
-
-
Save iOS0x00/9909237 to your computer and use it in GitHub Desktop.
Js APP struct demo
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 App = function() { | |
// Basic Config | |
var config = { | |
debug: true | |
}; | |
// HomeView | |
var home = function() { | |
console.log('hello home'); | |
}; | |
// End of HomeView | |
return { | |
init: function(options) { | |
//Extends basic config with options | |
$.extend(config, options); | |
}, | |
/*Pages Javascript Methods*/ | |
home: function() { | |
home(); | |
}, | |
}; | |
}(); | |
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
<script type="text/javascript"> | |
$(document).ready(function() { | |
//initialize the javascript | |
App.init(); | |
App.home(); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment