@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
35 lines (23 loc) • 978 B
Markdown
lang: en
title: 'API docs: context.inject.view'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context
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, metadata?: InjectionMetadata | undefined) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void
```
## Example
```ts
class MyControllerWithView {
@inject.view(filterByTag('foo'))
view: ContextView<string[]>;
}
```