https://github.com/johnpapa/angular-styleguide#style-y060
Shows a single responsibility factory making $http
requests and handling some logic and errors, returning the promise. Typically from there, I would store the results in a service (as opposed to controller $scope
so I can access it anywhere, including in directives). However:
Conversely, don't create a service whose only purpose in life is to store and return bits of data.
https://docs.angularjs.org/misc/faq
Should I store the data on the factory itself? Or continue with factory -> http
/ service -> storage
?
I'm not asking what the code difference is between the two, "one can be new'd etc", I'm asking for those that follow Angular best practices (skinny controllers, etc) what are the rules concerning the roles of a factory after it's fetched the data?