最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to get Backbone.Collection.remove to remove instance from server? - Stack Overflow

programmeradmin0浏览0评论

Backbone.Collection.remove removes a model from a collection in the front end. Is there a way to make the changes persist to the backend? ie. I want to do a DELETE request on the collection's URL and pass in the model. How would I do that?

Backbone.Collection.remove removes a model from a collection in the front end. Is there a way to make the changes persist to the backend? ie. I want to do a DELETE request on the collection's URL and pass in the model. How would I do that?

Share Improve this question edited Apr 16, 2012 at 6:04 mu is too short 435k71 gold badges858 silver badges818 bronze badges asked Apr 16, 2012 at 5:59 egidraegidra 9,08721 gold badges67 silver badges92 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11

model.destroy(); will remove the model from the collection and make a DELETE request to the server.

http://backbonejs/#Model-destroy

发布评论

评论列表(0)

  1. 暂无评论