##// END OF EJS Templates
working on di decorators
working on di decorators

File last commit:

r109:f71c50acc9f9 ioc ts support
r109:f71c50acc9f9 ioc ts support
Show More
Box.ts
32 lines | 671 B | video/mp2t | TypeScriptLexer
cin
dependency builder proposal
r108 import { Builder } from "../di/Annotations";
import { Bar } from "./Bar";
import { Foo } from "./Foo";
cin
Initial work on typescript support for the container configuration
r107
cin
working on di decorators
r109 const builder = new Builder<Box<Bar>, { bar: Bar; foo: Foo; obj: object }>();
cin
Initial work on typescript support for the container configuration
r107
cin
working on di decorators
r109 @builder.provides()
@builder.dependencies("bar")
export class Box<T> {
private _value: T | undefined;
cin
dependency builder proposal
r108
cin
working on di decorators
r109 constructor(value: T) {
this._value = value;
}
cin
Initial work on typescript support for the container configuration
r107
cin
dependency builder proposal
r108 @builder.inject("bar")
cin
Initial work on typescript support for the container configuration
r107 setValue(value: T) {
this._value = value;
}
cin
working on di decorators
r109
@builder.inject("foo")
setObj(value: object) {
}
cin
Initial work on typescript support for the container configuration
r107 getValue() {
cin
working on di decorators
r109 if (this._value === undefined)
throw new Error("Trying to get a value from the empty box");
cin
Initial work on typescript support for the container configuration
r107 return this._value;
}
cin
working on di decorators
r109 }