Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Didn't you mixed up the Factory and Service ? Services creates where factory returns. Commented Nov 9, 2014 at 6:06
  • When you declaring service name as an injectable argument you will be provided with an instance of the function. In other words new FunctionYouPassedToService(). This object instance becomes the service object that AngularJS registers and injects later to other services / controllers if required. //factory When you declaring factoryname as an injectable argument you will be provided with the value that is returned by invoking the function reference passed to module.factory. Commented Nov 23, 2014 at 4:31
  • Okay, so… in angular the factory is a singleton where the "service" is a actually a factory (in common design patterns terms) Commented Nov 23, 2014 at 8:24