Simplifying Different Types of Providers in Angular

An Angular Service provider delivers a runtime version of a dependency value. Therefore, when you inject a service, the Angular injector looks at the providers to create the instance of the service. It is the provider that determines which instance or value should be injected at the runtime in components, pipes, or directives. There is a lot of jargon involved here, so to understand the purpose of the types of providers, let us start with creating a service. Let’s say we have a service called ErrorService, which is just logging the error message.
import { Injectable } from ‘@angular/core’;

@Injectable()
export class ErrorService {

logError(message: string) {
console.log(message);
}
}

Link: https://dzone.com/articles/simplifying-different-types-of-providers-in-angula?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev