Created
August 11, 2014 16:32
-
-
Save greatseth/5b66afd03f0b8d5a25b0 to your computer and use it in GitHub Desktop.
Backbone collection subclass attempting to wrap a pattern during initialization. Does not seem to work!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'underscore', | |
'backbone' | |
], function (_, Backbone) { | |
var Collection = Backbone.Collection.extend({ | |
initialize: function(klass, objects) { | |
Backbone.Collection.prototype.initialize. | |
apply(this, _.flatten([objects]), { model: klass }); | |
} | |
}); | |
return Collection; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment