Service Providers
The service providers are a unique category of providers because there is not already a specific format for the resulting provider objects. Instead, a provider acts as a service to provide functionality. AngularJS provides some specific creation methods for building services and exposes them through the following methods:
■ value(name, object): This is the most basic of all providers. The object parameter is simply assigned to name, so there is a direct correlation in the injector between the name value and the object value.
■ constant(name, object): This is similar to the value() method, but the value is not changeable. Also, constant() methods are applied before other provider methods.
■ factory(name, factoryFunction): This ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access