Page Contents

Home > @loopback/context > Binding > bind

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.

Signature:

static bind<V = unknown>(key: BindingAddress<V>): Binding<V>;

Parameters

Parameter Type Description
key BindingAddress<V> Binding key

Returns:

Binding<V>