Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

Remove a model from a collection by id #142

Open
agruber opened this issue Apr 10, 2015 · 2 comments
Open

Remove a model from a collection by id #142

agruber opened this issue Apr 10, 2015 · 2 comments

Comments

@agruber
Copy link

agruber commented Apr 10, 2015

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
Copy link

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

@agruber
Copy link
Author

agruber commented Apr 14, 2015

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants