Skip to content

Function: isInjectable()

ts
function isInjectable(target: Newable<object>): boolean;

Defined in: src/wirestate-core/metadata/metadata-injectable.ts:64

Checks whether a class was directly marked with Injectable.

Parameters

ParameterTypeDescription
targetNewable<object>Class to check.

Returns

boolean

Whether the class is marked as injectable.

Remarks

The check does not walk the prototype chain. A subclass of an injectable class returns false until that subclass is decorated too.