##// END OF EJS Templates
Working on IoC container configuration
Working on IoC container configuration

File last commit:

r112:efce7387bfc8 ioc ts support
r112:efce7387bfc8 ioc ts support
Show More
Box.ts
27 lines | 531 B | video/mp2t | TypeScriptLexer
import { config } from "./config";
const service = config.build("barBox");
@service.consume(config.dependency("bar"))
export class Box<T> {
private _value: T | undefined;
constructor(value: T) {
this._value = value;
}
@service.inject("bar")
setValue(value: T) {
this._value = value;
}
setObj(value: object) {
}
getValue() {
if (this._value === undefined)
throw new Error("Trying to get a value from the empty box");
return this._value;
}
}