1) What is Backbone.js?
2) Backbone.js is written in which language ?
3) Give some history about Backbone.js.
It was released on 13 October,2010 and developed by Jeremy Ashkenas .
4) Enlist the main component of Backbone.js.
5) Describe Architecture of Backbone.js?
It follows the MVC Architecture:
- Model – It helps to retrieve code from the server.
- View – It is a HTML representation.
6) Describe the condition when can we use Backbone.js?
- We can use when developing single page web-application.
- To develop fast application having cleaner and more maintainable code.
7) Describe Backbone.js Events?
Backbone.js Events are the modules which helps the object to bind and trigger the custom events. These events can be called by desired name of our choice.
8) Enlist the method that can manipulate Backbone.js events.
9) Enlist all built-in events in Backbone.js.
- “add”(model, collection, options)
- “remove”(model, collection, options)
- “reset”(collection, options)
- “sort”(collection, options)
- “change”(model, options)
- “change:[attribute]”(model, value, options)
- “destroy”(model, collection, options)
- “request”(model_or_collection, xhr, options)
- “sync”(model_or_collection, resp, options)
- “error”(model_or_collection, resp, options)
11) Define Collection in Backbone.js?
Backbone.js collection is described as ordered set of models. It provides loading and saving of new models to the server. A helper function is created which perform aggregation and computation for a list of models.
12) Enlist the files required to setup Backbone.js.
Three files are required:
13) Give the method that can manipulate Backbone.js collection.
- Add etc.
14) What does Router in Backbone.js do?
It is used for routing client side application and connects them to their respective events and actions. Also, for an AJAX heavy applications it can be used to change the URL fragment of an application in order to provide bookmark-able and sharable URL’s.
15) Explain Backbone.js sync?
It is a function in Backbone.js which is called repeatedly. Backbone.js sync read or save a model to the server and also persist the state of the model to the server.
16) Enlist the method that can manipulate Backbone.js sync.
17) Explain Backbone.js View.
18) Define the term Modelbinder.
It is a Class in Backbone.js which is used to make the synchronization process of views and model together.
19) Give Configuration option available in Backbone.js .
- change Triggers
20) Define model.cid?
It is a special property of models, the cid or client id is automatically assigned to all models when they are first created. It works as an Unique Identifier.
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) What is the use of setElement ?
setElement is a function which is used when Backbone view has to be applied to a different DOM element.
23) Explain History in Backbone.js.
Backbone.History is used to keep track of the navigation history of different routes. It is also used to match the appropriate route and callbacks to handle events.
24) What is Template?
Template is used for the view. It is the HTML DOM elements for any View.
24) What is Utility?
Backbone.js Utility class define the following two methods:
- Backbone.noConflict: This method returns the Backbone object back to its original value. We can also use a local instance of Backbone by using method Backbone.noConflict().
- Backbone.$: This method allows user to use the particular jquery.
25) What is Converter?
Converter function helps to copy models attribute to a html attribute and vise versa.
26) What is ModelBinder in Backbone.js?
ModelBinder allows to define scope when you create your bindings using jQuery. We can also define scoping with jQuery selectors if the views are complex.
27) What is Memory Leaks in Backbone.js Application?
A memory leak is a gradual loss of available computer memory. It occurs when a program repeatedly fails to return memory it has obtained for temporary use.
28) 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.
29) What is Push State ?
It allow to navigate to URLs without actually needing a page to refresh.
30) Explain Backbone.Model?
A model is a representation of any component use in application. Therefore, a model can be represented as following: Data + Logic = Model