Can you give an example of how to build a collection?
Answer / 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 |
Explain when you can use unbinding function in backbone.js ?
What is collection in backbone.js?
Describe backbone events?
What is the purpose of backbone.js?
Explain architecture of backbone?
What is the function of tojson ?
Explain how you can use backbone.js for multiple page web app ?
Explain the architecture of backbone.js
What is backbone.sync is used for ?
What is a view in backbone.js?
Why you use backbone.js, not other frameworks?
How do you define view in backbone.js?