backbone-recursive-model

0.0.2 • Public • Published

Backbone Recursive Model

Is this for me?

If you need to nestle Backbone models in each other and keep instance references and event bindings after .save(), then this is the ticket.

Node.js

$ npm install backbone backbone-recursive-model

Backbone is not set as a dependency in the package.json but is required to be installed to use the RecursiveModel class. The reason for this is because you need to share the same instance of Backbone.

require('backbone-recursive-model');
var Backbone = require('backbone');

var MyModel = Backbone.RecursiveModel.extend({});

Or

var RecursiveModel = require('backbone-recursive-model');

var MyModel = RecursiveModel.extend({});

Browser

Just include the index.js file in a script tag together with Backbone and your ready to go.

/backbone-recursive-model/

    Package Sidebar

    Install

    npm i backbone-recursive-model

    Weekly Downloads

    4

    Version

    0.0.2

    License

    none

    Last publish

    Collaborators

    • icetan