What is Provider in Angular Js?
What is Provider in Angular Js? You can define Provider as service which is configurable and which should be used when you want to expose an API for application-wide configuration that must be made before the application starts. So technically speaking, it make sense during bootstrap(config) phase. During application bootstrap, before AngularJS goes off creating all services, it configures and instantiates all providers. We call this the configuration phase of the application life-cycle . During this phase, services aren't accessible because they haven't been created yet. Once the configuration phase is over, interaction with providers is disallowed and the process of creating services starts. We call this part of the application life-cycle the run phase . So simply speaking there is no way to use any service in config phase except constant & Provider. Technically, a Provider is defined as an object with a $get function. Example - So let s...