CyclicDependencyError

export class CyclicDependencyError

exported from angular2/core defined in angular2/src/core/di/exceptions.ts (line 85)

Thrown when dependencies form a cycle.

Example (live demo)

var injector = Injector.resolveAndCreate([ provide("one", {useFactory: (two) => "two", deps: [[new Inject("two")]]}), provide("two", {useFactory: (one) => "one", deps: [[new Inject("one")]]}) ]); expect(() => injector.get("one")).toThrowError();

Retrieving A or B throws a CyclicDependencyError as the graph above cannot be constructed.

Constructor

constructor(injector: Injector, key: Key)

Not Yet Documented