Page Contents

Home > @loopback/context > inject > tag

inject.tag variable

Inject an array of values by a tag pattern string or regexp

Signature:

tag: (bindingTag: BindingTag | RegExp, metadata?: InjectionMetadata | undefined) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void

Example

class AuthenticationManager {
  constructor(
    @inject.tag('authentication.strategy') public strategies: Strategy[],
  ) {}
}