Home » Backbone.js new View()

Backbone.js new View()

by Online Tutorials Library

Backbone.js View Constructor / Initialize

The Backbone.js view Constructor is called when the view is first created. It initializes the view. It uses new keyword and get called when the view is created. It is one of the several special options that will be attached directly to the view.

Syntax:

Parameter explanation:

options: It is optional. It can be model, collection, id, className, tagName, attributes, and events.

Let’s take an example.

See this example:

You may also like