generator-cg-angular icon indicating copy to clipboard operation
generator-cg-angular copied to clipboard

yo cg-angular:controller my-controller

Open eduardoinnorway opened this issue 11 years ago • 4 comments

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

eduardoinnorway avatar Oct 07 '14 18:10 eduardoinnorway

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.

bolora avatar Oct 10 '14 12:10 bolora

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

eduardoinnorway avatar Oct 10 '14 15:10 eduardoinnorway

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 :)

adnasa avatar Oct 12 '14 09:10 adnasa

"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.

cerdman avatar Mar 14 '15 16:03 cerdman