Answer Posted / Chhatrpal Singh
To create a collection in Backbone.js, first define the model, then create a new instance of that model and add it to a new collection: var MyModel = Backbone.Model.extend({}); var myModelInstance = new MyModel({ name: 'John' }); var myCollection = new Backbone.Collection([myModelInstance]);
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers