Note: I'm not seeking the differences between the value, factory, service, and provider 'recipes', as explained here.
I'm looking for clarification on the different ways to define them: Correct me if I'm wrong, but it appears as though
myApp = angular.module('myApp', [])
.value(...)
.factory(...)
.service(...)
.provider(...)
map to
$provide.value()
$provide.factory()
$provide.service()
$provide.provider()
And you can use either way. I asked this question, and realize I can use $provide
as a dependency to module().config()
. My questions:
- When/why would I use angular.module().provider() vs using the
$provide
dependency? - Is there any way (or reason) to access/change a provider after definition?
- Using AngularJS Batarang for Chrome, I'm looking at the various angular
$scope
properties, and don't see$provide
or$injector
. Where do these live?