Page Contents

Home > @loopback/context > Context > findOrCreateBinding

Context.findOrCreateBinding() method

Find or create a binding for the given key

Signature:

findOrCreateBinding<T>(key: BindingAddress<T>, policy?: BindingCreationPolicy): Binding<T>;

Parameters

Parameter Type Description
key BindingAddress<T> Binding address
policy BindingCreationPolicy (Optional) Binding creation policy

Returns:

Binding<T>