Home » Backbone.js Router.extend()

Backbone.js Router.extend()

by Online Tutorials Library

Backbone.js Router.extend()

The Backbone.js router extend method is used to extend the router class and create new constructor inherited from the Backbone.Router. It defines some triggered actions when specific URL fragments are matched and provides routes for those actions.

Syntax:

Parameter explanation:

  • properties: It specifies the instance properties for the router class.
  • classProperties: It specifies the class properties that are attached to the router’s constructor function.

Let’s take an example.

See this example:

You may also like