Service injection aliasing with useClass and useExisting
As your application becomes more complex, you may come to a situation where you would like to use your services in a polymorphic style. More specifically, some places in your application may want to request Service A, but a configuration somewhere in your application will actually give it Service B. This recipe will demonstrate one way in which this can be useful, but this behavior allows your application to be more extensible in multiple ways.
The code, links, and a live example of this are available at http://ngcookbook.herokuapp.com/1109/.
Suppose you begin with the following skeleton application.
You begin with two services,