shootsoft / sails-angular-crud

CURD based on sails & angular

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sails-ng-curd

Generate scaffold for sails application. Ajax create/update/remove/pagination/search using JQuery and Angular.js.

CURD function based on

Usage

On the command line

$ 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

Example Project

Quick Start

  1. Define your Model

api/models/Test.js

module.exports = {

  attributes: {

    att_id : {     
    	type: 'integer',
        primaryKey: true 
    },

    att1 : { type: 'string' },

    att2 : { type: 'string' }
  }
};
  1. 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

  1. Generate your controller/view/js
sails generate ng-curd test att_id att1 att2
  1. Launch your sails and visit http://localhost:1337/Test
sails lift

UI Prevew

List page

New or edit record

#TODO

  • complete test project
  • support attribute type
  • help file
  • quick start
  • auto load model's attributes
  • angular module

About

CURD based on sails & angular


Languages

Language:JavaScript 56.0%Language:HTML 43.6%Language:CSS 0.4%