I'm curious to find out why resetting a backbone collection doesn't fire a model event. However, it seems only logical to fire a model event when a model is physically being removed from a collection.
Is this intentional or am I missing something? If backbone doesn't do this sort of thing what's a good practice for delegating events like so.
Why does backbone not trigger a model event when its collection resets?
var TicketModel = Backbone.Model.extend({
defaults: {
name: 'crafty',
email: 'dwq@dwqcqw.com'
},
initialize: function(){
this.on("all", function(event){
console.log(event)
});
}
});
var TicketCollection = Backbone.Collection.extend({
model: TicketModel,
});
var tickets = new TicketCollection([
{
name: 'halldwq'
},
{
name: 'dascwq'
},
{
name: 'dsacwqe'
}
]);
tickets.reset();