Skip to main content

Function: Inject()

Inject(type, options?): (target, propertyKey) => void

Defined in: core/src/decorators/ObjectDecorators.ts:22

Injects an object instance to the decorated property of the given name and type using the provided arguments if no object has been created yet.

Parameters​

type​

any

The fully qualified name or type of the class to instantiate. If a type is given it's class name will be inferred via the constructor name.

options?​

InstanceOptions

The set of options to use when creating new instances of the injected class type.

Returns​

(target, propertyKey) => void