Options
All
  • Public
  • Public/Protected
  • All
Menu

Service metadata is used to initialize service and store its state.

Type parameters

  • T

  • K: keyof T

Hierarchy

  • ServiceMetadata

Index

Properties

Optional factory

factory: [ObjectType<T>, K] | function

Factory function used to initialize this service. Can be regular function ('createCar' for example), or other service which produces this instance ([CarFactory, 'createCar'] for example).

Optional global

global: boolean

Indicates if this service must be global and same instance must be used across all containers.

Optional id

id: Token<any> | string | Function

Service unique identifier.

Optional multiple

multiple: boolean

Allows to setup multiple instances the different classes under a single service id string or token.

Optional transient

transient: boolean

Indicates if instance of this class must be created on each its request. Global option is ignored when this option is used.

Optional type

type: Function

Class type of the registering service. Can be omitted only if instance is set. If id is not set then it serves as service id.

Optional value

value: any

Instance of the target class.

Generated using TypeDoc