Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

ExtJS style class definition for Backbone

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 README.md
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
README.md

backbone-define

ExtJS style class definition for Backbone.

Build Status

Useful for being able to iterate available classes such as when defining classes server side and sharing with client. This can be done without knowing to code in names on both sides.

By default store Classes on Backbone.Collections, Backbone.Models, etc;

exmaple

Backbone.Model.define("Person", {
    initialize: function(attributes) {
        Backbone.Model.prototype.initialize.call(this, attributes);
    }
}, {
    someClassProperty: "withvalue"
});

var zaphod = new Backbone.Models.Person({
    name: "Zap"
});

Including in the browser will automatically bootstrap Backbone with the Class Objects and adding .define to available extensible Classes.

Use in Node

var Backbone = require("Backbone");
require("backbone-define")(Backbone);
Something went wrong with that request. Please try again.