Skip to content

Instantly share code, notes, and snippets.

@swallentin
Created September 20, 2012 05:58
Show Gist options
  • Save swallentin/3754192 to your computer and use it in GitHub Desktop.
Save swallentin/3754192 to your computer and use it in GitHub Desktop.
Backbone.js Collection Template
var Todos = Backbone.Collection.extend({
url: "/todos",
model: Todo,
parse: function(res) {
return res.response.todos;
},
comparator: function (todo) {
return todo.get("priority");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment