destroy
can.Model.prototype.destroy
Destroy a Model on the server.
model.destroy([success[, error]])
Parameters
-
success
{function()}
OptionalA callback to call on successful destruction. The callback recieves the can.Model as it was just prior to destruction.
-
error
{function()}
OptionalA callback to call when an error occurs. The callback receives the XmlHttpRequest object.
Returns
{can.Deferred}
A Deferred that resolves to the Model as it was before destruction.
Destroys the instance by calling [Can.Model.destroy] with the id of the instance.
This triggers "destroyed" events on the instance and the Model constructor function which can be listened to with bind and bind.