Generate scaffold for sails application. Ajax create/update/remove/pagination/search using JQuery and Angular.js.
CURD function based on
$ sails generate ng-curd <a name for your scaffold> <primarykey> <optional: attributename:attributetype> <optional: --force>
Example:
$ sails generate scaffold user id name:string age:integer email:email
- Define your Model
api/models/Test.js
module.exports = {
attributes: {
att_id : {
type: 'integer',
primaryKey: true
},
att1 : { type: 'string' },
att2 : { type: 'string' }
}
};
- Add JQuery, Bootstrap, JQuery Datatables, JQuery Block UI, Angular, Angular Datatables into your layout file
Examples: https://github.com/shootsoft/sails-ng-curd/blob/master/tests/views/layout.ejs
- Generate your controller/view/js
sails generate ng-curd test att_id att1 att2
- Launch your sails and visit http://localhost:1337/Test
sails lift
#TODO
- complete test project
- support attribute type
- help file
- quick start
- auto load model's attributes
- angular module