Last active
December 20, 2015 21:39
-
-
Save mhkeller/6199130 to your computer and use it in GitHub Desktop.
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
var collectionFactoryHelpers = { | |
empty_arr: [], | |
createCollectionOfModels: function(model, arr_of_objects){ | |
var arr = _.clone(this.empty_arr); | |
arr_of_objects.forEach( function(item){ | |
arr.push( new model(item) ); | |
}); | |
return arr; | |
} | |
}; | |
var ElementCollection = new ElementCollectionPrototype( | |
collectionFactoryHelpers.createCollectionOfModels(ElementModel, data.account.values) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment