Skip to content

Tutorial: Backbone Models

originalgremlin edited this page Nov 4, 2012 · 2 revisions

Reference

Backbone models are convenient data containers. In a sense, they can be treated as javascript versions of rows in a database. If your database supports a RESTful API (as CouchDB does) then the relationship is almost transparent: creating, updating, and deleting Backbone models translates directly into creating, updating, and deleting documents (or rows) in the database.

var ComingSoonModel = Backbone.Model.extend({  
    urlRoot: '/api/kazifasta',  
    defaults: {  
        type: 'coming soon email',  
        email: '',  
        timestamp: 0  
    }  
});  

Clone this wiki locally