UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

28 lines (18 loc) 1.1 kB
--- lang: en title: 'API docs: context.inject.setter' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context permalink: /doc/en/lb4/apidocs.context.inject.setter.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [inject](./context.inject.md) &gt; [setter](./context.inject.setter.md) ## inject.setter variable Inject a function for setting (binding) the given key to a given value. (Only static/constant values are supported, it's not possible to bind a key to a class or a provider.) This is useful e.g. when implementing Actions that are contributing new Elements. See also `Setter<T>`<!-- -->. <b>Signature:</b> ```typescript setter: (bindingKey: BindingAddress, metadata?: InjectBindingMetadata | undefined) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void ```