What is dependency injection in Angular?
Angular has a robust DI framework that gives declared dependencies to a class upon instantiation. To inject a service, you must first create and register the injectable service.
Related Article: Angular 8 interview questions and Answers
BY Best Interview Question ON 24 Jun 2020
Example
import { Injectable } from '@angular/core';
@Injectable({ providedIn: 'root', })
export class SampleService { constructor() { } }