I have a backbone collection of models.
MyCollection = Backbone.Collection.extend({
model: myMymodel;
});
MyModel = Backbone.Model.extend({
...
});
Each model has a view
myView = Backbone.View.extend({
initialize: function() {
this.model = new MyModel();
};
});
There is no persistence on the server-side. This is just for structuring client-side information. So the models do not have ids, and a url for Backbone.sync has not been configured.
From within the view, I want to remove the model from the collection.
I have tried the following:
this.model.trigger( "destroy" );
However it does not work. The destroy event is not propagating to the collection.
Any idea what I'm doing wrong?
Thanks,