Implementing Backbone.Subset.js in Backbone.js to filter Models from a parent Collection

谁说胖子不能爱 提交于 2019-12-04 03:00:24

Looking at the source for backbone-subset, it looks as though there is a pre-initialization hook which you could utilize in order to make the 'sieve' or filter available as an option or argument:

https://github.com/masylum/Backbone.Subset/blob/master/backbone.subset.js#L50

As for providing parent as an argument, there is an outstanding patch to add that exact functionality:

https://github.com/masylum/Backbone.Subset/pull/5

With it, you can pass in parent as an option, if it is not an option the library will fall back to looking for it on the object Prototype

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!