NestJS · Senior · Question 3 of 75
How is the DI container organized across modules?
- 1There is one flat global container
- ✓Correct answer: Each module has its own injector scope; providers are visible inside the module and in modules that import it only if exported
- 3Each controller has its own container
Explanation
This encapsulation is why the same class listed in two modules' providers results in two instances.