Re:An Intro to Backbone.js: Part 3 - Binding a Collection to...
by jlyke on Thursday February 17, 2011 @10:33AM
(#2231237)
Do you have any better examples? I'd like to learn more about where this would fit in a real app.
[ Parent
| on HN ]
Re:An Intro to Backbone.js: Part 3 - Binding a Collection to...
by jashkenas on Thursday February 17, 2011 @10:57AM
(#2231338)
Sure ... some of these have source code available, and some do not.
http://documentcloud.github.com/backbone/#examples
In particular the TileMill example (launched yesterday) is a really sophisticated map editing application, with annotated source code available, here:
http://tilemill.com/docs/models.html
(Use "Jump To", at the top right, to get around)
If you'd like to get your feet wet, and play around with models a little, try visiting http://www.documentcloud.org/public
Pop open a JS console, and try...
Documents.length
Documents.first().set({title: "Changing the Title Syncs the View"})
Documents.first().set({description: "Lorem Ipsum Dolor Sit Amet"})
... then click on "Annotated Documents", at the top left, go back to the console, and try: Documents.first().notes.fetch()
Documents.first().notes.first().set({content: "Writing a Note."})
You get the idea.