Created
June 8, 2012 04:26
-
-
Save nodebotanist/2893580 to your computer and use it in GitHub Desktop.
Bit of the example app for a slide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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