Dependency Injection-Angular 2
Dependency Injection
- As a design pattern and a framework
- Supplies instance of a class with fully-formed dependencies
- Maintains a container of previously created service instances
- To use DI for a service, we register it as a provider in one of two ways
when bootstrapping the application,or in the component metadata.