Backbone.js Utility

The utility class consists of a set of methods for implementing Backbone utility. Following are two methods that can be used to manipulate the Backbone.js utility:

1) Backbone.noConflict: It returns the Backbone objects back to its original value and provides a facility to store reference to a backbone. It can be used to embed backbone on third-party websites, where you don’t want to thrash the existing backbone.

  1. var localBackbone = Backbone.noConflict();  
  2. var model = localBackbone.Model.extend(…);  

2) Backbone.$: This property is used when you have multiple copies of jQuery on the page, or simply want to tell Backbone to use a particular object as its DOM / Ajax library.

  1. Backbone.$ = require(‘jquery’);  


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *