forked from toastdriven/guide-to-testing-in-django
-
Notifications
You must be signed in to change notification settings - Fork 13
Initializing
mjumbewu edited this page Oct 6, 2012
·
1 revision
What I do when I create a new JavaScript project:
-
Create a libs directory for 3rd-party libraries
-
Download Backbone, Underscore, Bootstrap, jQuery, and sometimes Mustache, Leaflet
-
Create an index.html file, and include all the libraries
-
Come up with a namespace name for my project
-
Create
models.js
,routes.js
, cause I know I'm gonna need them -
Create
app.js
for my application conductor (controller?) objectvar <Namespace> = <Namespace> || {}; (function(NS) { NS.App = function() { // Create model caches and top-level views here. }; })(<Namespace>);
-
At the bottom of
index.html
, load the JS files, and create an app object:<script> $(function() { <Namespace>.app = new <Namespace>.App() }); </script>