Created
January 7, 2013 02:59
-
-
Save shinokada/4471959 to your computer and use it in GitHub Desktop.
Developing backbone.js applications page 29
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
/*Doesn't check for existence of myApplication*/ | |
var myApplication = {}; | |
/* | |
Does check for existence. If already defined, we use that instance. | |
Option 1: if(!myApplication) myApplication = {}; | |
Option 2: var myApplication = myApplication || {}; | |
We can then populate our object literal to support models, views and collections (or any data, really): | |
*/ | |
var myApplication = { | |
models : {}, | |
views : { | |
pages : {} | |
}, | |
collections : {} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment