##// END OF EJS Templates
added provided and configure methods to the fluent container configuration, added applyConfig method to the container
added provided and configure methods to the fluent container configuration, added applyConfig method to the container

File last commit:

r134:511bcc634d65 ioc ts support
r142:be7edf08a115 v1.4.0-rc3 default
Show More
Box.ts
28 lines | 682 B | video/mp2t | TypeScriptLexer
import { Bar } from "./Bar";
// export service descriptor
// через service передается информация о типе зависимости
// даже если это шаблон.
// export const service = annotate<Box<Bar>>();
// @service.wire()
export class Box<T> {
private _value: T | undefined;
constructor(value?: T) {
this._value = value;
}
// @service.inject(dependency("bar"))
setValue(value: T) {
this._value = value;
return value;
}
getValue() {
if (this._value === undefined)
throw new Error("Trying to get a value from the empty box");
return this._value;
}
}