| Start |
|---|
| Provider
The Provider recipe is syntactically defined as a custom type that implements a `$get` method. You should use the Provider recipe only when you want to expose an API for application-wide configuration that must be made before the application starts. This is usually interesting only for reusable services whose behavior might need to vary slightly between applications. endpoint = http://some.rest.endpoint (opens new window) Without endpoint = n/a |
| Factory
The Factory recipe constructs a new service using a function with zero or more arguments (these are dependencies on other services). The return value of this function is the service instance created by this recipe. Factory can create a service of any type, whether it be a primitive, object literal, function, or even an instance of a custom type. endpoint = http://some.rest.endpoint (opens new window) |
| Constant
endpoint = http://some.rest.endpoint (opens new window) |
| Service
The Service recipe produces a service just like the Value or Factory recipes, but it does so by invoking a constructor with the new operator. The constructor can take zero or more arguments, which represent dependencies needed by the instance of this type. endpoint = http://some.rest.endpoint (opens new window) |
| Value
endpoint = http://some.rest.endpoint (opens new window) Syntax
RemarksProviders are singleton objects that can be injected, for example, into other services, controllers and directives. All providers are registered using different "recipes", where
Services, Factories and Providers are all lazy initialized, component is initialized only if application depends on it. Decorators (opens new window) are closely related to Providers. Decorators are used to intercept service or factory creation in order to change it's behavior or override (parts of) it. |
Read Article
https://develop.horje.com/learn/1434/reference