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 Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
|
|
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
A class decorated with |
Returns
Section titled “Returns”A factory provider that constructs the decorated class.
Throws
Section titled “Throws”InvalidProviderError When the class has no @Injectable
metadata.