feat(di): add OpaqueToken to DI

Using `new Object()` as a token causes cryptic errors. OpaqueToken class should be used instead.
This commit is contained in:
vsavkin
2014-11-25 18:52:42 -08:00
parent 6187b80ce6
commit 6f889e3094
3 changed files with 21 additions and 9 deletions

View File

@ -4,3 +4,4 @@ export * from './binding';
export * from './key';
export * from './module';
export * from './exceptions';
export * from './opaque_token';

View File

@ -0,0 +1,11 @@
export class OpaqueToken {
_desc:string;
constructor(desc:string){
this._desc = `Token(${desc})`;
}
toString() {
return this._desc;
}
}