Skip to content

Commit 16f3212

Browse files
authored
feat: remove unnecessary code
1 parent 8b082f1 commit 16f3212

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

content/fundamentals/discovery-service.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,7 @@ console.log(controllers);
5959

6060
#### Finding Metadata
6161

62-
`DiscoveryService` can help find metadata attached to providers or controllers. This is useful when working with decorators that add metadata.
63-
64-
```typescript
65-
const providers = this.discoveryService.getProviders();
66-
67-
for (const provider of providers) {
68-
const metadata = this.reflector.get('custom:metadataKey', provider.instance.constructor);
69-
if (metadata) {
70-
console.log(`Metadata found:`, metadata);
71-
}
72-
}
73-
```
74-
75-
##### Example: Custom Decorator with DiscoveryService
76-
77-
Suppose you have a custom decorator that adds metadata to a provider:
62+
`DiscoveryService` can help find metadata attached to providers or controllers. This is useful when working with decorators that add metadata. Let's see an example. Suppose you have a custom decorator that adds metadata to a provider:
7863

7964
```typescript
8065
import { DiscoveryService } from '@nestjs/core';

0 commit comments

Comments
 (0)