Skip to content

Instantly share code, notes, and snippets.

@nathanpalmer
Created July 31, 2011 03:05
Show Gist options
  • Save nathanpalmer/1116330 to your computer and use it in GitHub Desktop.
Save nathanpalmer/1116330 to your computer and use it in GitHub Desktop.
var ItemCollection = Spine.Model.setup("Item", [ "itemToAdd", "items" ]);
ItemCollection.extend(DataBind);
ItemCollection.include({
addItem: function() {
if (this.itemToAdd != "") {
this.items.push(this.itemToAdd);
this.itemToAdd = "";
this.save();
}
}
});
var Item = ItemCollection.create({ itemToAdd: "", items: [ "Alpha", "Beta", "Gamma" ] });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment