Page Contents
Home > @loopback/context > inject > view
inject.view() function
Inject matching bound values by the filter function
Signature:
view: (bindingFilter: BindingFilter, metadata?: InjectionMetadata) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void
Parameters
| Parameter | Type | Description |
|---|---|---|
|
bindingFilter |
A binding filter function | |
|
metadata |
(Optional) |
Returns:
(target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void
Example
class MyControllerWithView {
@inject.view(filterByTag('foo'))
view: ContextView<string[]>;
}