Answer the question
In order to leave comments, you need to log in
How to delete multiple models in backbone?
Hello. Please tell me how can I remove several models from the collection. I do like this
addElement: function(el){
if(this.collection.get(el.get('id')))
this.collection.remove(el.get('id'));
else
this.collection.add(el);
console.log(this.collection);
}
....
....
....
_.each(this.collection.models, function(model){
model.destroy();
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question