@loopback/docs
Version:
Documentation for LoopBack 4
35 lines (22 loc) • 865 B
Markdown
lang: en
title: 'API docs: context.inject.view'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.context.inject.view.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [inject](./context.inject.md) > [view](./context.inject.view.md)
## inject.view variable
Inject matching bound values by the filter function
<b>Signature:</b>
```typescript
view: (bindingFilter: BindingFilter<unknown>, metadata?: InjectionMetadata | undefined) => (target: Object, member: string, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void
```
## Example
```ts
class MyControllerWithView {
@inject.view(filterByTag('foo'))
view: ContextView<string[]>;
}
```