---
lang: en
title: 'API docs: context.inject.getter'
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.getter.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; [getter](./context.inject.getter.md)

## inject.getter() function

Inject a function for getting the actual bound value.

This is useful when implementing Actions, where the action is instantiated for Sequence constructor, but some of action's dependencies become bound only after other actions have been executed by the sequence.

See also `Getter<T>`<!-- -->.

**Signature:**

```typescript
getter: (bindingSelector: BindingSelector<unknown>, metadata?: InjectionMetadata) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  bindingSelector | [BindingSelector](./context.bindingselector.md)<!-- -->&lt;unknown&gt; | The binding key or filter we want to eventually get value(s) from. |
|  metadata | [InjectionMetadata](./context.injectionmetadata.md) | _(Optional)_ Optional metadata to help the injection |

**Returns:**

(target: Object, member: string \| undefined, methodDescriptorOrParameterIndex?: number \| TypedPropertyDescriptor&lt;any&gt; \| undefined) =&gt; void


