googlearchive / backbonefire

Backbone bindings for Firebase
https://backbonefire.firebaseapp.com
MIT License
291 stars 77 forks source link

Remove a model from a collection by id #142

Open agruber opened 9 years ago

agruber commented 9 years ago

When I try to remove a model from a Backbonefire collection, I get an error:

id = 'CuFqD1rcPb'; myCollection.remove(id);

Cannot assign to read only property 'id' of CuFqD1rcPb TypeError: Cannot assign to read only property 'id' of CuFqD1rcPb

lifehackett commented 9 years ago

I think you need to pass in a model (or array of models) as opposed to the id. http://backbonejs.org/#Collection-remove

agruber commented 9 years ago

According to this answer in stack overflow it should work for regular backbone.js http://stackoverflow.com/questions/10400630/remove-a-backbone-model-by-id