cgross / generator-cg-angular

Yeoman generator for Enterprise Angular projects.
MIT License
592 stars 198 forks source link

yo cg-angular:controller my-controller #65

Open eduardoinnorway opened 10 years ago

eduardoinnorway commented 10 years ago

I think there should be a cg-angular:controller out of the box.....

bolora commented 10 years ago

But is there ever a controller without a partial or directive? The idea, in the spirit of rails is to provide generation of the basic building blocks of an app. A controller by itself cannot really do anything without a view.

eduardoinnorway commented 10 years ago

True, this was before I even tried out the partial sub-generator, so miss from my side ;)

adnasa commented 10 years ago

I may actually agree on this.

I'm just started with cg-ng, but I'm suspecting that I would need multiple controllers in one representing partial/component for multiple sub-views and states of my application.

bookmarking this for future comments :)

cerdman commented 9 years ago

"But is there ever a controller without a partial or directive?"

I don't agree with it at all -- in a complex app it is useful to have a BaseController class + several other "common" controllers that are inherited in child controllers. We use these to handle things like managing LocalStorage (LocalStorageController); User (UserController) etc. They don't have partials or directives.