mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
Giving Collections a clone() method.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user