Skip to content

Commit a753b9d

Browse files
Merge pull request #2100 from micalevisk/enhance-overview-modules
docs(modules): clarify about `exports` array of `@Module()` options
2 parents 0b7f71f + fa5b19d commit a753b9d

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

content/modules.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,12 @@ Each application has at least one module, a **root module**. The root module is
88

99
The `@Module()` decorator takes a single object whose properties describe the module:
1010

11-
<table>
12-
<tr>
13-
<td><code>providers</code></td>
14-
<td>the providers that will be instantiated by the Nest injector and that may be shared at least across this module</td>
15-
</tr>
16-
<tr>
17-
<td><code>controllers</code></td>
18-
<td>the set of controllers defined in this module which have to be instantiated</td>
19-
</tr>
20-
<tr>
21-
<td><code>imports</code></td>
22-
<td>the list of imported modules that export the providers which are required in this module</td>
23-
</tr>
24-
<tr>
25-
<td><code>exports</code></td>
26-
<td>the subset of <code>providers</code> that are provided by this module and should be available in other modules which import this module</td>
27-
</tr>
28-
</table>
11+
| | |
12+
|-|-|
13+
| `providers` | the providers that will be instantiated by the Nest injector and that may be shared at least across this module |
14+
| `controllers` | the set of controllers defined in this module which have to be instantiated |
15+
| `imports` | the list of imported modules that export the providers which are required in this module |
16+
| `exports` | the subset of `providers` that are provided by this module and should be available in other modules which import this module. You can use either the provider itself or just its token (`provide` value) |
2917

3018
The module **encapsulates** providers by default. This means that it's impossible to inject providers that are neither directly part of the current module nor exported from the imported modules. Thus, you may consider the exported providers from a module as the module's public interface, or API.
3119

0 commit comments

Comments
 (0)