Page Contents

Home > @loopback/context > Binding > to

Binding.to() method

Bind the key to a constant value. The value must be already available at binding time, it is not allowed to pass a Promise instance.

Signature:

to(value: T): this;

Parameters

Parameter Type Description
value T The bound value.

Returns:

this

Example

ctx.bind('appName').to('CodeHub');