ResolvedReflectiveProvider

Experimental Interface

Interface Overview

interface ResolvedReflectiveProvider {
  key : ReflectiveKey
  resolvedFactories : ResolvedReflectiveFactory[]
  multiProvider : boolean
}

Interface Description

An internal resolved representation of a Provider used by the Injector.

It is usually created automatically by Injector.resolveAndCreate.

It can be created manually, as follows:

Example (live demo)

var resolvedProviders = Injector.resolve([{ provide: 'message', useValue: 'Hello' }]);
var injector = Injector.fromResolvedProviders(resolvedProviders);

expect(injector.get('message')).toEqual('Hello');

Interface Details

key : ReflectiveKey

A key, usually a Type<any>.

resolvedFactories : ResolvedReflectiveFactory[]

Factory function which can return an instance of an object represented by a key.

multiProvider : boolean

Indicates if the provider is a multi-provider or a regular provider.

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

doc_Angular
2016-10-06 09:46:56
Comments
Leave a Comment

Please login to continue.