Giving Collections a clone() method.

This commit is contained in:
Phil Freo
2012-04-19 11:17:41 -07:00
parent b536b137b8
commit 7eca8c78b6

View File

@@ -791,6 +791,11 @@
return resp;
},
// Create a new collection with an identical list of models as this one.
clone: function() {
return new this.constructor(this.models);
},
// Proxy to _'s chain. Can't be proxied the same way the rest of the
// underscore methods are proxied because it relies on the underscore
// constructor.