Disclaimer: I am not inquiring about the distinctions between the value, factory, service, and provider 'recipes' as detailed here.
I am seeking clarification on the different methods of defining them. It seems that
myApp = angular.module('myApp', [])
.value(...)
.factory(...)
.service(...)
.provider(...)
equates to
$provide.value()
$provide.factory()
$provide.service()
$provide.provider()
And both ways are valid. As seen from this question, I have realized you can use $provide
as a dependency for module().config()
. My inquiries are:
- When/why should I utilize angular.module().provider() instead of using the
$provide
dependency? - Is there any method (or reason) to access/change a provider after it has been defined?
- While inspecting the various angular
$scope
properties with AngularJS Batarang for Chrome, I cannot locate$provide
or$injector
. Where can these be found?