@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
36 lines (23 loc) • 1.13 kB
Markdown
---
lang: en
title: 'API docs: context.context.findorcreatebinding'
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.context.findorcreatebinding.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [Context](./context.context.md) > [findOrCreateBinding](./context.context.findorcreatebinding.md)
## Context.findOrCreateBinding() method
Find or create a binding for the given key
<b>Signature:</b>
```typescript
findOrCreateBinding<T>(key: BindingAddress<T>, policy?: BindingCreationPolicy): Binding<T>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | [BindingAddress](./context.bindingaddress.md)<!-- --><T> | Binding address |
| policy | [BindingCreationPolicy](./context.bindingcreationpolicy.md) | Binding creation policy |
<b>Returns:</b>
[Binding](./context.binding.md)<!-- --><T>