##// END OF EJS Templates
configuration interfaces moved to di/Configuration module...
configuration interfaces moved to di/Configuration module ActivationType converted to string literals Working on annotations

File last commit:

r118:6738ac4c3072 ioc ts support
r118:6738ac4c3072 ioc ts support
Show More
Box.ts
38 lines | 764 B | video/mp2t | TypeScriptLexer
cin
sync
r117 import { services } from "../di/Annotations";
import { Bar } from "./Bar";
cin
configuration interfaces moved to di/Configuration module...
r118 import { Foo } from "./Foo";
cin
Initial work on typescript support for the container configuration
r107
cin
working on IoC configuration
r114 // declare required dependencies
cin
sync
r117 const config = services<{
bar: Bar;
cin
configuration interfaces moved to di/Configuration module...
r118 foo: Foo;
cin
sync
r117 }>();
cin
working on IoC configuration
r114
// export service descriptor
cin
sync
r117 export const service = config.build<Box<Bar>>();
cin
Initial work on typescript support for the container configuration
r107
cin
configuration interfaces moved to di/Configuration module...
r118 @service.consume(config.get("bar"))
cin
working on di decorators
r109 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
configuration interfaces moved to di/Configuration module...
r118 @service.inject( config.get("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 }
cin
working on di decorators
r109 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 IoC configuration
r114 }