##// 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
Bar.ts
33 lines | 583 B | video/mp2t | TypeScriptLexer
import { Foo } from "./Foo";
import { build } from "./config";
const service = build<Bar>();
@service.consume({
foo: service.get("foo"),
nested: {
lazy: service.lazy("foo")
}
})
export class Bar {
barName = "bar";
_v: Foo | undefined;
constructor(_opts?: {
foo?: Foo;
nested?: {
lazy: () => Foo
}
}) {
if (_opts && _opts.foo)
this._v = _opts.foo;
}
getFoo() {
if (this._v === undefined)
throw new Error("The foo isn't set");
return this._v;
}
}