Put in order · NestJS course · Module 1: NestJS Basics

Dependency Injection Process

Arrange the steps of the Dependency Injection process in NestJS from start to finish:

Items to put in order

  • Registration in the module's providers array
  • Defining a provider with @Injectable()
  • Using the service in class methods
  • Injection through the constructor
Show the answer

Correct order:

  1. Defining a provider with @Injectable()
  2. Registration in the module's providers array
  3. Injection through the constructor
  4. Using the service in class methods