FactoryProvider

Stable

Interface

What it does

Configures the Injector to return a value by invoking a useFactory function.

How to use

function serviceFactory() { ... } const provider: FactoryProvider = {provide: 'someToken', useFactory: serviceFactory, deps: []};

Interface Overview

interface FactoryProvider {
provide : any
useFactory : Function
deps : any[]
multi : boolean

}

Interface Description

Interface Details

exported from @angular/core/index, defined in @angular/core/src/di/provider.ts