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:
- Adding @Injectable() to the new service
- Importing the module with the exported service
- Injecting the service through the constructor
- Calling a method of the injected service