@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
36 lines (23 loc) • 1.22 kB
Markdown
---
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) > [@loopback/context](./context.md) > [Binding](./context.binding.md) > [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`<!-- -->.
<b>Signature:</b>
```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 options for binding and dependency resolution |
<b>Returns:</b>
[ValueOrPromise](./context.valueorpromise.md)<!-- --><T \| undefined>