The following explanations were taking from various Angular docs, Misko code examples and StackOverflow posts.
- Service returns an instance of the actual function
- Factory returns function’s return value
- Provider returns the output of the function’s $get function
Factories are an example of the revealing module pattern.
Providers have the advantage that they can be configured during module configuration phase.
Under the hood
Services, Factories as well as Values are all created under the hood using Providers.