Home Manual Reference Source Repository
import Backbone from 'backbone-es6/src/Backbone.js'
public class | version 1.2.3 | source

Backbone

Backbone.js

(c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Backbone may be freely distributed under the MIT license.

For all details and documentation: http://backbonejs.org


Backbone-ES6 https://github.com/typhonjs/backbone-es6 (c) 2015 Michael Leahy Backbone-ES6 may be freely distributed under the MIT license.

This fork of Backbone converts it to ES6 and provides extension through constructor injection for easy modification. The only major difference from Backbone is that Backbone itself is not a global Events instance anymore. Please see @link{Events.js} for documentation on easily setting up an ES6 event module for global usage.

See:

Constructor Summary

Public Constructor
public

constructor(Collection: Collection, Events: Events, History: History, Model: Model, Router: Router, View: View, sync: function, options: object)

Initializes Backbone by constructor injection.

Member Summary

Public Members
public

$: *

jQuery or equivalent

public

A public reference of the Collection class.

public

Events: *

A public reference of the Events class.

public

History: *

A public reference of the History class.

public

Model: *

A public reference of the Model class.

public

Router: *

A public reference of the Router class.

public

View: *

A public reference of the View class.

public

Set the default implementation of Backbone.ajax to proxy through to $.

public

history: *

A public instance of History.

public

sync: *

A public instance of the sync function.

Public Constructors

public constructor(Collection: Collection, Events: Events, History: History, Model: Model, Router: Router, View: View, sync: function, options: object) source

Initializes Backbone by constructor injection. You may provide variations on any component below by passing in a different version. The "runtime" initializing Backbone is responsible for further modification like supporting the older "extend" support. See backbone-es6/src/ModuleRuntime.js and backbone-es6/src/extend.js for an example on composing Backbone for usage.

Params:

NameTypeAttributeDescription
Collection Collection

A class defining Backbone.Collection.

Events Events

A class defining Backbone.Events.

History History

A class defining Backbone.History.

Model Model

A class defining Backbone.Model.

Router Router

A class defining Backbone.Router.

View View

A class defining Backbone.View.

sync function

A function defining synchronization for Collection & Model.

options object

Options to mixin to Backbone.

Public Members

public $: * source

jQuery or equivalent

public Collection: * source

A public reference of the Collection class.

public Events: * source

A public reference of the Events class.

public History: * source

A public reference of the History class.

public Model: * source

A public reference of the Model class.

public Router: * source

A public reference of the Router class.

public View: * source

A public reference of the View class.

public ajax: XMLHttpRequest: * source

Set the default implementation of Backbone.ajax to proxy through to $. Override this if you'd like to use a different library.

Return:

XMLHttpRequest

XMLHttpRequest

public history: * source

A public instance of History.

public sync: * source

A public instance of the sync function.