jquery - Backbone : access model's data from collection's remove method -


i looking way remove 1 of model's data sets using collection's remove method. doesn't seem work in way. there way remove data in model collection's method?

here code.

       helloworldmodel.set({things: value});        helloworldcollection.add([          {things: helloworldmodel.get("things")}        ]);        helloworldcollection.remove(?????????); 

thanks

you need reference object add collection remove it; following possible solution. though create actual model containing slimmed down version of other model:

helloworldmodel.set({things: value}); obj = {things: helloworldmodel.get("things")} helloworldcollection.add(obj); helloworldcollection.remove(obj); 

Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -