I have a collection myCollection
to which I add models as follows:
myCollection.add({title: Romeo and Juliette, author: Shakespear});
Have can I now save this added model to the server? Backbone Collection
s do not have a save()
and I do not a reference to the added model to call save
directly.
You can use the create function on the collection to add a model and have it automatically saved to the server.
Here's the documentation on the create function.
You could bind the save method of your collection to the add event: