Page Contents

Home > @loopback/context > inject

inject namespace


export declare namespace inject 


Variable Description
binding Inject the binding object for the given key. This is useful if a binding needs to be set up beyond just a constant value allowed by @inject.setter. The injected binding is found or created based on the metadata.bindingCreation option. See BindingCreationPolicy for more details.
context Inject the context object.
getter Inject a function for getting the actual bound value.This is useful when implementing Actions, where the action is instantiated for Sequence constructor, but some of action’s dependencies become bound only after other actions have been executed by the sequence.See also Getter<T>.
setter Inject a function for setting (binding) the given key to a given value. (Only static/constant values are supported, it’s not possible to bind a key to a class or a provider.)This is useful e.g. when implementing Actions that are contributing new Elements.See also Setter<T>.
tag Inject an array of values by a tag pattern string or regexp
view Inject matching bound values by the filter function