@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
35 lines (22 loc) • 1.02 kB
Markdown
---
lang: en
title: 'API docs: context.binding.bind'
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.bind.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [Binding](./context.binding.md) > [bind](./context.binding.bind.md)
## Binding.bind() method
A static method to create a binding so that we can do `Binding.bind('foo').to('bar');` as `new Binding('foo').to('bar')` is not easy to read.
<b>Signature:</b>
```typescript
static bind<V = unknown>(key: BindingAddress<V>): Binding<V>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | [BindingAddress](./context.bindingaddress.md)<!-- --><V> | Binding key |
<b>Returns:</b>
[Binding](./context.binding.md)<!-- --><V>