@loopback/docs
Version:
Documentation for LoopBack 4
27 lines (17 loc) • 985 B
Markdown
---
lang: en
title: 'API docs: context.inject.setter'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.context.inject.setter.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [inject](./context.inject.md) > [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<unknown>, metadata?: InjectBindingMetadata | undefined) => (target: Object, member: string, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void
```