You are thinking along the right direction. This is exactly how you should be breaking up your code. The controller should be devoid of both dom manipulation ( directive ) and business logic / models ( service! ).
On Mon, Sep 15, 2014 at 3:32 PM, Ben Rethmeier <[email protected]> wrote: > I'm getting started with Angular coming from an MVVM (XAML) > world\perspective. I started by seeing my controller as my ViewModel and I > just put everything on its scope and had thought that services were > primarily for like server call services (ajax call to get some data or > something). Now I'm starting to feel like I should make all code into a > service and just glue them together in a controller and have the controller > have really no code, just pulling things from services onto the scope. Does > that sound reasonable? I know you can use the tool anyway you like, so I > guess I'm asking what do people usually put in their controllers and is > there good reason not to put it in a service other than preference or ease? > > Any thoughts, opinions, or feedback is appreciated. > > -- > You received this message because you are subscribed to the Google Groups > "AngularJS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- Regards, Ganaraj P R -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
