Skip to main content

Interface: FactoryProvider<T>

An interface for factory providers in the dependency injection system. It extends the base provider interface and adds a property for the factory function to be used.

Extends​

  • BaseProvider<T>

Type Parameters​

T​

T = unknown

Properties​

forClass​

forClass: ClassType<T>


inject?​

optional inject?: Token[]


scope​

scope: InjectableScopes


token​

token: Token<T>

Inherited from​

BaseProvider.token


useFactory​

useFactory: (...args) => T | Promise<T>

Parameters​

args​

...any[]

Returns​

T | Promise<T>