1) Explain what is backbone.js ?
2) What are the main components of Backbone.js ?
The main component of Backbone.js are
3) Explain what is Backbone.js collections ?
An ordered set of models are represented by Backbone.js collections. Any event in model will trigger an event in collection directly. For example, you can bind “change” event to be notified in a case when any model in the collection has been modified.
4) Explain what is Backbone.js router is used for ?
Whenever an application want to change their URL fragment in order to provide bookmarkable and shareable URLs for an Ajax heavy application, backbone.js router is used.
5) What is Backbone events ?
Backbone events is a module that can be mixed in to any object, giving the object the ability to bind and trigger custom named events. Events are not declared before they are bound to any object . Events reflects the state of the model.
6) What are the keypoints of Backbone ?
7) Why you have to use Backbone ? Advantages ?
8) What are the three js files that you require to setup a working environment for backbone?
you are required following three js files to setup a working environment for backbone
In your application put these files within js folder and use it in your index.html page
9) Explain when you require Backbone.js ?
Backbone.js is required in following condition
10) Explain what is view in Backbone.js?
11) Explain what is Backbone.js Models?
Backbone.js models are object and core of backbone.js. It contains an array of attributes and listens for events. To represent your data, Backbone provides a model object. For example, you have a to do list, you would have a model representing each item on that list.
12) Explain how you can use backbone.js for multiple page web app ?
For multiple page web app in backbone.js there are lots of consideration but here are two which can be useful
13) Explain what is Modelbinder in Backbone.js ?
To make synchronization process of views and models together, ModelBinder class is used.
14) What is the most powerful capabilities of the ModelBinder ?
The most powerful capabilities of ModelBinder class is that it enables you to define scope when you create your bindings using jQuery.
15) Explain what is Converter in Backbone.js ?
A function is called when model’s attribute is copied to an html element or when an html element value is copied into a model’s attribute, this function is referred as Converter in Backbone.js
16) What is model.attributes ?
The attributes property is the internal hash containing the model’s state, usually a form of the JSON object representing the model data on the server. It is often a straightforward serialization of a row from the database
17) What is the function of toJSON ?
It returns a shallow copy of the model’s attribute for JSON stringification. This function is used for persistence, serialization and for augmentation before being sent to the server. This does not return a JSON string
18) Explain when you can use Unbinding function in Backbone.js ?
When you want to remove the validation binding on the model or all models , removing all events hooked up on the collection, you can use Unbinding function.
For example : Backbone.Validation.Unbind(view) [ This will remove the validation binding]
19) What are the configuration options available ?
The configuration options available are
20) Mention what are the typical problems you might face with the Backbone view code ?
21) What is the function of escape ?
It gets the current value of an attribute from the model but returns the HTML-escaped version of a model’s attribute. It is helpful in preventing XSS attacks, if you are interpolating data from the model into HTML
22) Explain what is the function of parse ?
Whenever a model’s data is returned by the server, in fetch and save , this data is called parse. It is called by Backbone whenever a collection’s models are returned by server, in fetch.
23) What is Backbone.sync is used for ?
When Backbone wants to save or read a model to the server it calls out a function called as Backbone.sync.
24) In Backbone View, what is the use of setElement ?
setElement function is used when Backbone view has to be applied to a different DOM element.
25) Explain what is model.cid ?
Model.cid works as a unique identifier. It is a special property of models, the cid or client id is automatically assigned to all models when they are first created. This property is useful when the model is not saved to the server, but needs to be visible in the UI. It takes the from c1,c2….