• Stars
    star
    122
  • Rank 292,031 (Top 6 %)
  • Language
    JavaScript
  • Created over 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

generator-angular-crud allows creating entities and CRUD operations very productively for AngularJS applications

generator-angular-crud

generator-angular-crud is a yeoman generator based on the great John Papa's hottowel generator. This generator generates the code using the Angular Style Guide written by John Papa. The generated code is based in a proven structure and conventions for developing Angular applications.

generator-angular-crud allows creating entities and CRUD operations very productively.

Currently, this generator is adapted for working with a Sails backend, although it's very easy to adapt it for working with whatever backend.

The generator allows creating entities automatically in a table form from where you can create, read, update and remove each database record.

Demo Application

You can see a demo application developed with generator-angular-crud at Angular CRUD Demo

Video Tutorial

Angular CRUD

Backend with Sails

At first place, you will have to create your API with Sails. However, when you get a list of records, Sails won't give you information regarding the total records, so you can't paginate properly. For example, if I request this: http://localhost:1337/customer, I get the following information:

[
  {
    code: 'customer 1'
  },
  {
    code: 'customer 2'
  },
  {
    code: 'customer 3'
  }
]

But if I have to paginate I need information regarding the total number of records. So, I have to override the find blueprint. To do this, you have to copy from this project the file sails/api/blueprints/find.js into your ROOT_PROJECT/api/blueprints/find.js. Now, if I request this: http://localhost:1337/customer, I will get the following information:

{
  total: 1000,
  results: [
    {
      code: 'customer 1'
    },
    {
      code: 'customer 2'
    },
    {
      code: 'customer 3'
    }
  ]
}

With this object we have all the information that we need to paginate.

Next steps that you have to do with Sails are:

  • npm install lodash --save
  • update config/models to enable the following parameter: migrate: 'alter'
  • update config/cors to set allRoutes: true and origin: '*'
  • generate your api with sails generate api

Frontend Quickstart

You will need to install generator-angular-crud:

$ npm install -g generator-angular-crud

You have to create a new folder for your project and from this folder you will generate your application:

$ yo angular-crud

Next, you will create a new feature, a customer, for example:

$ yo angular-crud:feature <customer>

This will create an AngularJS application supporting full CRUD functionality.

This subgenerator will create an entity with two properties called 'name' and 'street'. If we want to add new properties to our entity, we need to follow these steps:

  • Add new properties to the angular-formly array properties in src/client/app/feature-name/services/feature-name.form.client.service.js
  • Add new columns for the new properties in the HTML table in src/client/app/feature-name/views/list.html

TODO

  • Improve validation errors returned by the server
  • Websockets to get realtime notifications
  • Adaptors for different backends (Firebase, Backand, ...)
  • Testing

License

MIT

More Repositories

1

generator-spring-rest-jwt

Creates the skeleton of an API REST developed with Spring Boot, that uses JWT to protect the API
Java
46
star
2

voteExpress

This is a demo application that integrates node.js, express, mongoose and angular.js to develop a simple vote application.
JavaScript
39
star
3

upload-firebase

This project is an Angular2 demo to show how to use Firebase Storage to upload images in Firebase and how to use Firebase Realtime Database to see in real time the files that are uploaded.
TypeScript
35
star
4

node-sales-order-processing

Sales Order Processing with MEAN arquitecture
JavaScript
15
star
5

jlmonteagudo-cam

Broadcasting video
JavaScript
12
star
6

react-redux-api-rest-example

Aplicaciรณn React/Redux que se conecta al API de un servidor remoto para recuperar un listado de usuarios y mostrar ese listado en forma de tabla.
JavaScript
11
star
7

generator-meanjs-table

meanjs-table is a yeoman generator based on the great meanjs generator that displays entities in a table form from where you can create, read, update and remove each database record
JavaScript
10
star
8

WebPlaces

Angular Backoffice. This is the backoffice module of a system developed with Angular, Ionic and Firebase
TypeScript
9
star
9

schematics-ng-material-crud

Schematis generator that allows to create entities and manage CRUD operations of these entities. The UI is built with Angular Material and uses a table with server side filtering, sorting and pagination
TypeScript
9
star
10

IonicPlaces

Ionic Starter Kit. This is the mobile module of a system developed with Angular, Ionic and Firebase
TypeScript
8
star
11

vue-commerce-vuetify

e-commerce application developed with Vue, Vuetify, Vuex and Firestore
JavaScript
7
star
12

node-express-moongose-min-bootstrap

Minimal skeleton application that helps to bootstrap your node.js, express and moongose application
JavaScript
5
star
13

sop

SOP (Sales Order Processing) demo application for the blog http://www.jlmonteagudo.com to demonstrate how to develop an MEAN stack application
JavaScript
5
star
14

sales-management-client

Front End Application developed with generator-angular-crud for managing a sales process. It requires of a SailsJS backend.
JavaScript
4
star
15

ionic2-firebase-chat

JavaScript
3
star
16

ng-commerce

e-commerce application with Angular in the frontend and WooCommerce in the backend
TypeScript
3
star
17

sales-management-server

API REST for a Sales Management Application
JavaScript
2
star
18

nx-starter-kit

Starter kit with Angular NX Extensions
TypeScript
2
star
19

sales-order-processing

Prototype project for managing Sales Order Processing with C# and Entity Framework
C#
2
star
20

angular-ssr

Sample project of Angular SSR with deployment in Firebase.
TypeScript
2
star
21

vue-commerce-quasar

Ecommerce solution built with Vue
JavaScript
2
star
22

node-server-crud-sample

RESTful API, developed with Node, Express and Mongoose. This server is part of a system composed by this server and a front end application developed with Angular that shows how to develop a CRUD system.
JavaScript
2
star
23

ionic2-starter-sidemenu-tabs

Starter Ionic2 with sidemenu and tabs
CSS
1
star
24

nx-users

TypeScript
1
star
25

spike-sequelize

JavaScript
1
star
26

bitstarter

JavaScript
1
star
27

boot-express

Express server configured to server RESTful APIs
JavaScript
1
star
28

nx-nebular

TypeScript
1
star
29

blog-ch1-api

Sample developing a very simple REST API with NodeJS and ExpressJS
JavaScript
1
star
30

basic-auth-nestjs

Basic Auth with Nestjs and Angular. JWT and Refresh Tokens
TypeScript
1
star
31

shop-phones

JavaScript
1
star
32

firebase-auth-template

Template that manages authentication with Firebase
CSS
1
star
33

nx-workspace-with-ssr

Example repository showing how to implement angular universal in a nx workspace
TypeScript
1
star
34

ngfire-cms

CMS Starter Kit developed with Angular and Firebase
TypeScript
1
star
35

ng-material-crud-sample

This project is a sample that shows how to develop a CRUD system. Angular Material has been used to design the UI. This project is part of a system composed by a node server and a front end application developed with Angular that shows how to develop a CRUD system.
TypeScript
1
star