angular-docs-cn/public/docs/js/latest/api/di/CyclicDependencyError-class.jade
2015-06-01 23:18:32 -07:00

38 lines
673 B
Plaintext

p.location-badge.
exported from <a href='../di'>angular2/di</a>
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/di/exceptions.ts#L103-L130">angular2/src/di/exceptions.ts (line 103)</a>
:markdown
Thrown when dependencies form a cycle.
## Example:
```javascript
class A {
constructor(b:B) {}
}
class B {
constructor(a:A) {}
}
```
Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(key)
:markdown