Skip to content

Instantly share code, notes, and snippets.

@nodebotanist
Created June 8, 2012 04:26
Show Gist options
  • Save nodebotanist/2893580 to your computer and use it in GitHub Desktop.
Save nodebotanist/2893580 to your computer and use it in GitHub Desktop.
Bit of the example app for a slide
App.toDo = Backbone.Model.extend({
idAttribute: 'attributes.key',
initialize: function(){
this.key = this.get('key');
}
});
App.toDoList = Backbone.Collection.extend({
model : App.toDo,
initialize : function(){
var self = this;
//get from Local Storage
Lawnchair(function(){
this.all(function(items){
_.each(items, function(item){
if(item.complete == false){
self.add(item);
}
});
});
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment