Page Contents
Home > @loopback/context > Context > bind
Context.bind() method
Create a binding with the given key in the context. If a locked binding already exists with the same key, an error will be thrown.
Signature:
bind<ValueType = BoundValue>(key: BindingAddress<ValueType>): Binding<ValueType>;
Parameters
Parameter | Type | Description |
---|---|---|
key | BindingAddress<ValueType> | Binding key |
Returns:
Binding<ValueType>