fix: Improve error message on missing dependency
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import {CONST} from 'angular2/src/facade/lang';
|
||||
import {CONST, stringify} from 'angular2/src/facade/lang';
|
||||
import {DependencyAnnotation} from 'angular2/src/di/annotations_impl';
|
||||
|
||||
/**
|
||||
@ -41,6 +41,7 @@ export class Attribute extends DependencyAnnotation {
|
||||
// account.
|
||||
return this;
|
||||
}
|
||||
toString() { return `@Attribute(${stringify(this.attributeName)})`; }
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,4 +54,5 @@ export class Attribute extends DependencyAnnotation {
|
||||
@CONST()
|
||||
export class Query extends DependencyAnnotation {
|
||||
constructor(public directive: any) { super(); }
|
||||
toString() { return `@Query(${stringify(this.directive)})`; }
|
||||
}
|
||||
|
@ -9,6 +9,9 @@ export class Visibility extends DependencyAnnotation {
|
||||
}
|
||||
|
||||
get includeSelf(): boolean { return isBlank(this._includeSelf) ? false : this._includeSelf; }
|
||||
toString() {
|
||||
return `@Visibility(depth: ${this.depth}, crossComponentBoundaries: ${this.crossComponentBoundaries}, includeSelf: ${this.includeSelf}})`;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,6 +54,7 @@ export class Visibility extends DependencyAnnotation {
|
||||
@CONST()
|
||||
export class Self extends Visibility {
|
||||
constructor() { super(0, false, true); }
|
||||
toString() { return `@Self()`; }
|
||||
}
|
||||
|
||||
// make constants after switching to ts2dart
|
||||
@ -102,6 +106,7 @@ export var self = new Self();
|
||||
@CONST()
|
||||
export class Parent extends Visibility {
|
||||
constructor({self}: {self?: boolean} = {}) { super(1, false, self); }
|
||||
toString() { return `@Parent(self: ${this.includeSelf}})`; }
|
||||
}
|
||||
|
||||
/**
|
||||
@ -164,6 +169,7 @@ export class Parent extends Visibility {
|
||||
@CONST()
|
||||
export class Ancestor extends Visibility {
|
||||
constructor({self}: {self?: boolean} = {}) { super(999999, false, self); }
|
||||
toString() { return `@Ancestor(self: ${this.includeSelf}})`; }
|
||||
}
|
||||
|
||||
/**
|
||||
@ -203,4 +209,5 @@ export class Ancestor extends Visibility {
|
||||
@CONST()
|
||||
export class Unbounded extends Visibility {
|
||||
constructor({self}: {self?: boolean} = {}) { super(999999, true, self); }
|
||||
toString() { return `@Unbounded(self: ${this.includeSelf}})`; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user