I'm trying to destroy a backbone model and it gets destroyed even on a service error.
View :
this.listenTo(this.collection, 'remove', function() {});
this.model.destroy({
success : function(model) {
/* remove the li view */
},
error : function() {}
});
In above case model is removed from collection whether it is a success/error.
Suppose if this destroy callback fails the model should not be removed from the collection. How can this be achieved?