---
lang: en
title: 'API docs: context.binding.getvalue_1'
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.binding.getvalue_1.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [Binding](./context.binding.md) &gt; [getValue](./context.binding.getvalue_1.md)

## Binding.getValue() method

Returns a value or promise for this binding in the given context. The resolved value can be `undefined` if `optional` is set to `true` in `options`<!-- -->.

**Signature:**

```typescript
getValue(ctx: Context, options?: ResolutionOptions): ValueOrPromise<T | undefined>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  ctx | [Context](./context.context.md) | Context for the resolution |
|  options | [ResolutionOptions](./context.resolutionoptions.md) | _(Optional)_ Optional options for binding and dependency resolution |

**Returns:**

[ValueOrPromise](./context.valueorpromise.md)<!-- -->&lt;T \| undefined&gt;


