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<T = unknown>(key: BindingAddress<T>): Binding<T>;

Parameters

Parameter Type Description
key BindingAddress<T> Binding key

Returns:

Binding<T>