Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Crud Generator. #524

Open
louim opened this issue Sep 5, 2014 · 9 comments
Open

Request: Crud Generator. #524

louim opened this issue Sep 5, 2014 · 9 comments
Milestone

Comments

@louim
Copy link

louim commented Sep 5, 2014

Hello and thanks for creating this really nice tool!

I would like to request a crud generator. Currently, we have the "things" section, but it is not really fleshed out, as you can't edit items after they are added, and items consist of only one field. It's also only an example, as there is no way to generate the code as is it. Would it be possible to create a Crud generator? We have an endpoint generator, I think it would really go well with it, allowing people less experimented (like me) to fully kickstart the app and get something running really quick. I think it would also help displaying the good practices when doing validation, etc...

Would it be much more complex to allow a list of fields to be passed when creating the endpoint? Something like that:

yo angular-fullstack:endpoint post name:string description:string lastUpdatedAt:date

Maybe after that it could ask if the user want to create a Crud based on that endpoint?
Things that would be really nice to have in the crud generator:

  • Full create / edit / list view
  • Field validation (displaying Mongoose error messages?)
  • Real-time updating
  • Role based edit / delete permission?

What do you think? Is it too complex to be done as a generator? Maybe then as more complex "Things" example could be done?

Once again, thank you guys for all you have done on this project, keep up the good work!

@mchapman
Copy link
Contributor

mchapman commented Sep 5, 2014

Have you looked at forms-angular? There is a fork of this generator that shows how it might be used. Rather than using the command line it uses a Mongoose schema.

Currently it does your first two bullet points. The last one is easily added in user applications (I can show an example). I would love help with the real-time bit...

(And sorry for jumping in)

@dancancro
Copy link

That feature is implemented in the following alternatives to generator-angular-fullstack:
Cleverstack
MEANjs.org
jhipster
MEAN.io
generator-angular-xl
generator-cg-angular

see row 257, "FEATURE"
http://www.dancancro.com/comparison-of-angularjs-application-starters/

@kingcody
Copy link
Member

Perhaps I'm missing something but the endpoint generator creates a CRUD API for the model that the endpoint is exposing. If socket.io was selected, then real time updated should already be available.

I'm guessing the model validations are what you would like to see added?

@louim
Copy link
Author

louim commented Sep 12, 2014

I'm more looking for a CRUD on the angularjs side to use the endpoint API. Something to scaffold views and controller to communicate with the endpoint.

@kingcody
Copy link
Member

I see, my apologizes for the confusion. Would generating a corresponding $resource on the client side help out?

@JaKXz
Copy link
Collaborator

JaKXz commented Sep 25, 2014

@kingcody's suggestion of using a $resource service is right on the money. @louim your suggestion is to have that generated when you type yo angular-fullstack:endpoint:withservice ..., correct?

@Awk34
Copy link
Member

Awk34 commented Sep 26, 2014

I like this idea. Even just something that creates a view with a simple interface for making each HTTP call that the endpoint supports would be some helpful scaffolding.

@Awk34 Awk34 added this to the 2.4.0 milestone Jul 16, 2015
@Awk34
Copy link
Member

Awk34 commented Sep 25, 2015

@mchapman
Copy link
Contributor

@louim Would the https://github.com/forms-angular/generator-angular-fullstack fork offer what you want? It adds a simple example CRUD form using https://github.com/forms-angular/forms-angular

(Sorry - just looked up the thread and seen I have already made this suggestion - ignore me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants