@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
81 lines (41 loc) • 1.5 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`<!-- -->.
**Signature:**
```typescript
getValue(ctx: Context, options?: ResolutionOptions): ValueOrPromise<T | undefined>;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
ctx
</td><td markdown="1">
[Context](./context.context.md)
</td><td markdown="1">
Context for the resolution
</td></tr>
<tr><td markdown="1">
options
</td><td markdown="1">
[ResolutionOptions](./context.resolutionoptions.md)
</td><td markdown="1">
_(Optional)_ Optional options for binding and dependency resolution
</td></tr>
</tbody></table>
**Returns:**
[ValueOrPromise](./context.valueorpromise.md)<!-- --><T \| undefined>