refactor(di): unified di injector and core injector
BREAKING CHANGES: * InjectAsync and InjectLazy have been removed * toAsyncFactory has been removed
This commit is contained in:
@ -140,15 +140,17 @@ export class CyclicDependencyError extends AbstractBindingError {
|
||||
export class InstantiationError extends AbstractBindingError {
|
||||
cause;
|
||||
causeKey;
|
||||
stack;
|
||||
|
||||
// TODO(tbosch): Can't do key:Key as this results in a circular dependency!
|
||||
constructor(cause, key) {
|
||||
constructor(cause, stack, key) {
|
||||
super(key, function(keys: List<any>) {
|
||||
var first = stringify(ListWrapper.first(keys).token);
|
||||
return `Error during instantiation of ${first}!${constructResolvingPath(keys)}. ORIGINAL ERROR: ${cause}`;
|
||||
});
|
||||
this.cause = cause;
|
||||
this.causeKey = key;
|
||||
this.stack = stack;
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,3 +200,18 @@ export class NoAnnotationError extends BaseException {
|
||||
|
||||
toString(): string { return this.message; }
|
||||
}
|
||||
|
||||
/**
|
||||
* Thrown when getting an object by index.
|
||||
*
|
||||
* @exportedAs angular2/di_errors
|
||||
*/
|
||||
export class OutOfBoundsError extends BaseException {
|
||||
message: string;
|
||||
constructor(index) {
|
||||
super();
|
||||
this.message = `Index ${index} is out-of-bounds.`;
|
||||
}
|
||||
|
||||
toString(): string { return this.message; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user