##// END OF EJS Templates
working on fluent configuration
working on fluent configuration

File last commit:

r127:850cc60b6e2a ioc ts support
r133:09ea4b9e3735 ioc ts support
Show More
Box.ts
29 lines | 724 B | video/mp2t | TypeScriptLexer
cin
sync
r117 import { Bar } from "./Bar";
cin
fluent configuration interfaces
r127 import { annotate, dependency } from "./services";
cin
working on IoC configuration
r114
// export service descriptor
cin
configuration draft-1
r119 // через service передается информация о типе зависимости
// даже если это шаблон.
cin
fluent configuration interfaces
r127 export const service = annotate<Box<Bar>>();
cin
Initial work on typescript support for the container configuration
r107
cin
fluent configuration interfaces
r127 @service.wire()
cin
working on di decorators
r109 export class Box<T> {
private _value: T | undefined;
cin
dependency builder proposal
r108
cin
fluent configuration interfaces
r127 constructor(value?: T) {
cin
working on di decorators
r109 this._value = value;
}
cin
Initial work on typescript support for the container configuration
r107
cin
configuration draft-1
r119 @service.inject(dependency("bar"))
setValue(value: T) {
cin
Initial work on typescript support for the container configuration
r107 this._value = value;
cin
configuration interfaces moved to di/Configuration module...
r118 return value;
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 IoC configuration
r114 }