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

Service Collaboration

Arrange the steps for creating a service that collaborates with another service:

Items to put in order

  • Adding @Injectable() to the new service
  • Importing the module with the exported service
  • Calling a method of the injected service
  • Injecting the service through the constructor
Show the answer

Correct order:

  1. Adding @Injectable() to the new service
  2. Importing the module with the exported service
  3. Injecting the service through the constructor
  4. Calling a method of the injected service