yeoman/generators — pull request #95 by jacobmumm (2012-10-14 05:56:15+00:00)
Title: Angular CRUD

I wanted to open this PR to talk about moving towards CRUD generation. Right now, the best option in the Angular generator is angular:route, which sets up a controller, a view and the routing. Here is the usage for angular:crud.

yeoman init angular:crud thing [--coffee]

This will create:
app/scripts/controllers/thing/thingIndex.js
app/scripts/controllers/thing/thingCreate.js
app/scripts/controllers/thing/thingList.js
app/scripts/controllers/thing/thingUpdate.js
app/views/thing/thingIndex.html
app/views/thing/thingCreate.html
app/views/thing/thingList.html
app/views/thing/thingUpdate.html
And add routing to:
app.js
/thing/index
/thing/create
/thing/list
/thing/update

I am putting the controllers and views into folders for organization, and routes follow the controller/action pattern. I think it would be better if all the controllers could be placed into a single file (thing.js with multiple controller definitions), but I'm not versed with Grunt enough at the moment.

If this looks good, by all means pull it. I just wanted to make an effort at this in the hope that the best solution for CRUDing comes out.

Additionally, looking to take this further, wouldn't it be great to do some kind of model-based scaffolding that could build forms and other templates instead of the blank files created by the generators now?