Created
January 7, 2013 03:17
-
-
Save shinokada/4472034 to your computer and use it in GitHub Desktop.
nested object namespacing with the object literal pattern from Developing Backbone.js Applications p31.
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 galleryApp = galleryApp || {}; | |
// perform similar check for nested children | |
galleryApp.routers = galleryApp.routers || {}; | |
galleryApp.model = galleryApp.model || {}; | |
galleryApp.model.special = galleryApp.model.special || {}; | |
// routers | |
galleryApp.routers.Workspace = Backbone.Router.extend({}); | |
galleryApp.routers.PhotoSearch = Backbone.Router.extend({}); | |
// models | |
galleryApp.model.Photo = Backbone.Model.extend({}); | |
galleryApp.model.Comment = Backbone.Model.extend({}); | |
// special models | |
galleryApp.model.special.Admin = Backbone.Model.extend({}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment