Not the elegant prince of our debauched and vicious art, not the jeweled idol of our society churches--but the Jesus of the awful reality, the man of sorrow and pain, the outcast, despised of the world, who had nowhere to lay his head--.
AngularJS uses $provide to register new providers. The providers basically create new instances, but only once for each provider. The $provide has six methods to create custom providers and I will explain each one of them with the help of sample code.
Each web application you build is composed of objects that collaborate to get stuff done. These objects need to be instantiated and wired together for the app to work. In AngularJS apps most of these objects are instantiated and wired together automatically by the injector service. The injector creates two types of objects, services and specialized objects. Services are objects whose API is defined by the developer writing the service.