If you want to follow AngularJS' 'best practices' and its loose adherence to the (M)odel (data) part of the MVC pattern then, yes, $resource is used within a 'service'. Note, it is also critical to understand that a 'service' is a 'singleton' which also lends itself well to the notion of a 'model' (data).
On Saturday, May 23, 2015 at 12:43:58 PM UTC-4, Deepak Sisodiya wrote: > > If i am using $http in controller, then $http should be moved in separate > service because it is not the responsibility of controller but when i am > using $resource in controller what should i do, it should be in a separate > service or not? > -- 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.
