@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
92 lines (49 loc) • 1.74 kB
Markdown
---
lang: en
title: 'API docs: context.inject.tag'
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.tag.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [inject](./context.inject.md) > [tag](./context.inject.tag.md)
## inject.tag() function
Inject an array of values by a tag pattern string or regexp
**Signature:**
```typescript
tag: (bindingTag: BindingTag | RegExp, metadata?: InjectionMetadata) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
bindingTag
</td><td markdown="1">
[BindingTag](./context.bindingtag.md) \| RegExp
</td><td markdown="1">
Tag name, regex or object
</td></tr>
<tr><td markdown="1">
metadata
</td><td markdown="1">
[InjectionMetadata](./context.injectionmetadata.md)
</td><td markdown="1">
_(Optional)_ Optional metadata to help the injection
</td></tr>
</tbody></table>
**Returns:**
(target: Object, member: string \| undefined, methodDescriptorOrParameterIndex?: number \| TypedPropertyDescriptor<any> \| undefined) => void
## Example
```ts
class AuthenticationManager {
constructor(
@inject.tag('authentication.strategy') public strategies: Strategy[],
) {}
}
```