##// END OF EJS Templates
working on IoC container
working on IoC container

File last commit:

r34:bf1098a8d031 di-typescript
r38:d3813a6cdb36 di-typescript
Show More
ValueDescriptor.ts
22 lines | 528 B | video/mp2t | TypeScriptLexer
/ src / ts / di / ValueDescriptor.ts
cin
ported IoC container to typescript...
r34 import { Descriptor } from "./interfaces";
import { ActivationContext } from "./ActivationContext";
export class ValueDescriptor<T> implements Descriptor {
_value: T
constructor(value: T) {
this._value = value;
}
activate(context: ActivationContext, name: string) {
context.enter(name);
let v = this._value;
context.leave();
return v;
}
isInstanceCreated(): boolean {
return true;
}
getInstance(): T {
return this._value;
}
}