Skip to content

provideInjectable · Core API

function provideInjectable<T>(target): FactoryProvider<T, DepsMap>;

Creates a factory provider from a class marked with @Injectable.

The returned provider is a normal di-craft factory provider, so scopes, optional dependencies, disposal hooks, overrides, and cycle detection behave the same as with provideFactory.

Type Parameter

T

Parameter Type Description

target

InjectableClass<T>

A class decorated with @Injectable.

FactoryProvider<T, DepsMap>

A factory provider that constructs the decorated class.

InvalidProviderError When the class has no @Injectable metadata.