##// END OF EJS Templates
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version

File last commit:

r134:511bcc634d65 ioc ts support
r146:f3f5c56d3b3e v1.4.0-rc5 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;
}
}