1.

What is dependency injection in Angular?

Answer»

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 AnswersExample

import { Injectable } from '@angular/core';
@Injectable({ providedIn: 'root', })
export class SampleService { constructor() { } }



Discussion

No Comment Found