Skip to content

Commit e17a6ea

Browse files
Update components.md
1 parent 3b3ea7e commit e17a6ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

content/components.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Providers are a fundamental concept in Nest. Many of the basic Nest classes may
44

55
<figure><img class="illustrative-image" src="/assets/Components_1.png" /></figure>
66

7-
In the previous chapter, we built a simple `CatsController`. Controllers should handle HTTP requests and delegate more complex tasks to **providers**. Providers are plain JavaScript classes that are declared as `providers` in a NestJS module. For more information, refer to the NestJS Module documentation.
7+
In the previous chapter, we built a simple `CatsController`. Controllers should handle HTTP requests and delegate more complex tasks to **providers**. Providers are plain JavaScript classes that are declared as `providers` in a NestJS module. For more information, see the "Modules" chapter.
88

99
> info **Hint** Since Nest enables the possibility to design and organize dependencies in a more OO way, we strongly recommend following the [SOLID principles](https://en.wikipedia.org/wiki/SOLID).
1010
@@ -122,13 +122,13 @@ constructor(private catsService: CatsService) {}
122122

123123
#### Scopes
124124

125-
Providers normally have a lifetime ("scope") synchronized with the application lifecycle. When the application is bootstrapped, every dependency must be resolved, and therefore every provider has to be instantiated. Similarly, when the application shuts down, each provider will be destroyed. However, there are ways to make your provider lifetime **request-scoped** as well. You can read more about these techniques in the [Injection Scopes documentation](/fundamentals/injection-scopes).
125+
Providers normally have a lifetime ("scope") synchronized with the application lifecycle. When the application is bootstrapped, every dependency must be resolved, and therefore every provider has to be instantiated. Similarly, when the application shuts down, each provider will be destroyed. However, there are ways to make your provider lifetime **request-scoped** as well. You can read more about these techniques in the [Injection Scopes](/fundamentals/injection-scopes) chapter.
126126

127127
<app-banner-courses></app-banner-courses>
128128

129129
#### Custom providers
130130

131-
Nest has a built-in inversion of control ("IoC") container that resolves relationships between providers. This feature underlies the dependency injection feature described above, but is in fact far more powerful than what we've described so far. There are several ways to define a provider: you can use plain values, classes, and either asynchronous or synchronous factories. More examples of defining providers can be found in the [Dependency Injection documentation](/fundamentals/dependency-injection).
131+
Nest has a built-in inversion of control ("IoC") container that resolves relationships between providers. This feature underlies the dependency injection feature described above, but is in fact far more powerful than what we've described so far. There are several ways to define a provider: you can use plain values, classes, and either asynchronous or synchronous factories. More examples of defining providers can be found in the [Dependency Injection](/fundamentals/dependency-injection) chapter.
132132

133133
#### Optional providers
134134

@@ -145,7 +145,7 @@ export class HttpService<T> {
145145
}
146146
```
147147

148-
Note that in the example above we are using a custom provider, which is the reason we include the `HTTP_OPTIONS` custom **token**. Previous examples showed constructor-based injection indicating a dependency through a class in the constructor. You can read more about custom providers and their associated tokens in the [Custom Providers documentation](/fundamentals/custom-providers).
148+
Note that in the example above we are using a custom provider, which is the reason we include the `HTTP_OPTIONS` custom **token**. Previous examples showed constructor-based injection indicating a dependency through a class in the constructor. You can read more about custom providers and their associated tokens in the [Custom Providers](/fundamentals/custom-providers) chapter.
149149

150150
#### Property-based injection
151151

0 commit comments

Comments
 (0)