sails-backbone-generator
Generate client-side Backbone.js Models from a Sails.js API. Uses Backbone Relational to generate relations, and implements validation rules using Anchor, the same library used to validate Sails.js models attributes.
Install
$ npm install sails-backbone-generator --save
Usage
Sails.js (Server)
Model
// Automobile.jsmoduleexports = attributes: name: type: 'string' alphanum: true primaryKey: true color: type: 'string' enum: 'black' 'black' ; // Truck.js_
Controller
var SailsBackbone = ;var schema = SailsBackbone;res;
Browser (Client)
appmodels = SailsBackbone;BackboneRelationalstore;
Translated into Backbone:
xmAutomobile = BackboneRelationalModel; xmTruck = xmAutomobile;
More
- npm: https://www.npmjs.org/package/sails-backbone-generator
- github: https://github.com/tjwebb/sails-backbone
- License: MIT