News for hackers. Stuff that matters.
Re:Todos: a Backbone.js example Single-Page-App (with LocalS... by eloop on Tuesday October 26, 2010 @04:18PM (#1835909)
Thanks for the great example. I'm already using Backbone.js in a project, it's a beautiful piece of code (along with underscore.js). One small thing, wouldn't it be better to create a new application specific namespace instead of adding so many globals ?
Re:Todos: a Backbone.js example Single-Page-App (with LocalS... by jashkenas on Tuesday October 26, 2010 @04:29PM (#1835961)
Yes -- a single hidden namespace would be cleaner, but then you miss out on all the fun of playing around with this stuff in the console! Here's some one-liners to try with a full Todo list:

    Todos.pluck("content");

    Todos.first().toggle();

    Todos.last().clear();