Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 833 Bytes

brisket.model.md

File metadata and controls

35 lines (23 loc) · 833 Bytes

Brisket.Model

An environment agnostic implementation of Backbone.Model.

Documentation Index

Simple Usage

To create a Model, just extend from Brisket.Model the same way you would a Backbone.Model.

var MyModel = Brisket.Model.extend();

Setting Up A BaseModel

While you can extend from Brisket.Model directly to build any Models that your site needs, it may make sense to set up a BaseModel for your site that provides application-specific features to all of your application's Models.

var BaseModel = Brisket.Model.extend({
    someFeature: function() {
        return this.id;
    }
});

var AppFoo = BaseModel.extend();

var appFoo = new AppFoo({ id: "example" });

appFoo.someFeature(); // example