Skip to content

Commit

Permalink
Merge pull request nestjs#2929 from valerii15298/patch-1
Browse files Browse the repository at this point in the history
Update execution-context.md
  • Loading branch information
kamilmysliwiec authored Dec 27, 2023
2 parents a3fd542 + 4c71172 commit f6dbca6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/fundamentals/execution-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export interface ExecutionContext extends ArgumentsHost {
}
```

The `getHandler()` method returns a reference to the handler about to be invoked. The `getClass()` method returns the type of the `Controller` class which this particular handler belongs to. For example, in an HTTP context, if the currently processed request is a `POST` request, bound to the `create()` method on the `CatsController`, `getHandler()` returns a reference to the `create()` method and `getClass()` returns the `CatsController` **type** (not instance).
The `getHandler()` method returns a reference to the handler about to be invoked. The `getClass()` method returns the type of the `Controller` class which this particular handler belongs to. For example, in an HTTP context, if the currently processed request is a `POST` request, bound to the `create()` method on the `CatsController`, `getHandler()` returns a reference to the `create()` method and `getClass()` returns the `CatsController` **class** (not instance).

```typescript
const methodKey = ctx.getHandler().name; // "create"
Expand Down

0 comments on commit f6dbca6

Please sign in to comment.