Page Contents

Home > @loopback/context > inject > view

inject.view variable

Inject matching bound values by the filter function

Signature:

view: (bindingFilter: BindingFilter<unknown>, metadata?: InjectionMetadata | undefined) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void

Example

class MyControllerWithView {
  @inject.view(filterByTag('foo'))
  view: ContextView<string[]>;
}