Showing posts with label clone. Show all posts
Showing posts with label clone. Show all posts

Wednesday, July 2, 2014

Filtering Models When Cloning Backbone Collections

Filtering collections is fundamental to most Backbone applications. This is generally done within the context of a view. The view needs to display some subset of the collection. It selects the models it needs, by calling the where() method on the collection. This gives us an array of model elements. However, the downside with where() is that once you call it, you're now working with an array of models — not a collection of models.