##// 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
Bar.ts
39 lines | 726 B | video/mp2t | TypeScriptLexer
import { Foo } from "./Foo";
import { annotate, dependency } from "./services";
export const service = annotate<Bar>();
@service.wire({
foo: dependency("foo"),
nested: {
lazy: dependency("foo", { lazy: true })
},
host: dependency("host")
}, "")
export class Bar {
barName = "Twister";
_v: Foo | undefined;
constructor(_opts: {
foo?: Foo;
nested?: {
lazy: () => Foo
},
host: string
}, s: string) {
if (_opts && _opts.foo)
this._v = _opts.foo;
}
setName(name: string) {
}
getFoo() {
if (this._v === undefined)
throw new Error("The foo isn't set");
return this._v;
}
}