Page Contents

Home > @loopback/context > inject > context

inject.context variable

Inject the context object.

Signature:

context: () => (target: Object, member: string, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void

Example

class MyProvider {
 constructor(@inject.context() private ctx: Context) {}
}