6 ms·
Do you have any better examples? I'd like to learn more about where this would fit in a real app.
by jlyke 16y ago
Do you have any better examples? I'd like to learn more about where this would fit in a real app.
- jashkenas 16y agoSure ... some of these have source code available, and some do not. http://documentcloud.github.com/backbone/#examples 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 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 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.