The angular app uses services ( $http , $location , etc.).
It is sometimes necessary to configure these services before using them. For example, the $location service has two execution modes: "normal" mode and "html5" mode. $http may need to configure some headers even if it sends its first HTTP request.
Angular uses providers to configure these services. Providers are objects whose role is to accept configuration parameters at the configuration stage, and then, when everything is configured, create a unique instance of the service.
So, to set up the $location service, you use its $locationProvider during the configuration phase. After this phase is completed, Angular, at the start-up phase, will call the provider method $get() , which will create and return the $location service (hence the name "provider").
Jb nizet
source share