Skip to content

InjectContext

@tsed/di

Usage

typescript
import { InjectContext } from "@tsed/di";

See /packages/di/src/types/node/decorators/injectContext.ts.

Overview

ts
function InjectContext(transform?: ($ctx: DIContext) => unknown): PropertyDecorator;

Description

Inject a context like PlatformContext or any BaseContext.

typescript
@Injectable()
export class MyService {
  @InjectContext()
  ctx?: Context;
}

Released under the MIT License.