Page Contents
Home > @loopback/context > Context > getBinding
Context.getBinding() method
Look up a binding by key in the context and its ancestors. If no matching binding is found, an error will be thrown.
Signature:
getBinding<ValueType = BoundValue>(key: BindingAddress<ValueType>): Binding<ValueType>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| key | BindingAddress<ValueType> | Binding key |
Returns:
Binding<ValueType>