Page Contents

Home > @loopback/context > Context > createView

Context.createView() method

Create a view of the context chain with the given binding filter

Signature:

createView<T = unknown>(filter: BindingFilter, comparator?: BindingComparator, options?: Omit<ResolutionOptions, 'session'>): ContextView<T>;

Parameters

Parameter Type Description
filter [BindingFilter](/doc/en/lb4/apidocs.context.bindingfilter.html) A function to match bindings
comparator [BindingComparator](/doc/en/lb4/apidocs.context.bindingcomparator.html) _(Optional)_ A function to sort matched bindings
options Omit<[ResolutionOptions](/doc/en/lb4/apidocs.context.resolutionoptions.html), 'session'> _(Optional)_ Resolution options

Returns:

ContextView<T>