News for hackers. Stuff that matters.
Re:Sample App with Backbone.js and Twitter Bootstrap by dts on Monday February 13, 2012 @04:23PM (#3587396)
Hmmm. Any reason all the views and models are attached to the window object instead of namespaced under some kind of app controller?
Re:Sample App with Backbone.js and Twitter Bootstrap by tbranyen on Monday February 13, 2012 @04:49PM (#3587477)
There are a number of issues with the project, but I'm assuming it was created this way to be easier to digest for newcomers.
Re:Sample App with Backbone.js and Twitter Bootstrap by smcguinness on Monday February 13, 2012 @05:00PM (#3587510)
Would you point out a few of them if you don't mind?
Re:Sample App with Backbone.js and Twitter Bootstrap by danso on Monday February 13, 2012 @05:13PM (#3587557)
Yeah, as a newcomer to Backbone, this has always been something that's thrown me off, including in the otherwise excellent Todo example: http://documentcloud.github.com/backbone/docs/todos.html

The backbone boilerplate on Github (by tbranyen) has been a useful model to follow: https://github.com/tbranyen/backbone-boilerplate/blob/master...

Re:Sample App with Backbone.js and Twitter Bootstrap by VMG on Tuesday February 14, 2012 @04:08AM (#3589249)
DocumentCloud (by the creator of Backbone) is also using window-bound variables. Seems to work for them I suppose.
Re:Sample App with Backbone.js and Twitter Bootstrap by jashkenas on Tuesday February 14, 2012 @07:44AM (#3589757)
Yes, when you're in control of the page, it's nice to be able to have different parts of your app ready-to-hand. In our case, that means Documents, Notes, Projects, Accounts, Organizations, and so on...

If your "app" is going to be embedded as a part of someone else's page, then you have to be much more careful. The results cards in the sidebar here are only exposed through a single variable: "eg2012.Card":

http://www.nytimes.com/2012/02/08/us/politics/minnesota-colo...