0

My question is , is there a way to detect the model that got removed from the collection when we bind/listen to the collection's add Event.

for ex:

this.listenTo(monthsOnBoardCollection, "remove", function(){
  //is it possible here to find what got removed from the collection ? 
}
digToGetWater
  • 171
  • 2
  • 9

1 Answers1

2

You have the Catalog of Events which shows the arguments being passes to the event.

"remove" (model, collection, options) — when a model is removed from a collection.

So it's basically:

this.listenTo(monthsOnBoardCollection, "remove", function(model, collection, options){
  //now you have the model, the collection and the options which were passed to the remove method
}
iMoses
  • 4,338
  • 1
  • 24
  • 39