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

File last commit:

r111:33420a95f637 ioc ts support
r114:475b8ce3e850 ioc ts support
Show More
Bar.ts
33 lines | 585 B | video/mp2t | TypeScriptLexer
cin
tests moved under src/ folder...
r50 import { Foo } from "./Foo";
cin
Working on IoC container configuration
r111 import { config } from "./config";
cin
tests moved under src/ folder...
r50
cin
Working on IoC container configuration
r111 const service = config.build("bar");
cin
tests moved under src/ folder...
r50
cin
Working on IoC container configuration
r111 @service.consume({
f: config.dependency("foo"),
nested: {
lazy: config.lazy("foo")
}
})
export class Bar {
barName = "bar";
cin
tests moved under src/ folder...
r50
cin
Working on IoC container configuration
r111 _v: Foo | undefined;
constructor(_opts: {
f: Foo;
nested: {
lazy: () => Foo
}
}) {
if (_opts && _opts.f)
this._v = _opts.f;
cin
tests moved under src/ folder...
r50 }
cin
working on di decorators
r109
getFoo() {
cin
Working on IoC container configuration
r111 if (this._v === undefined)
cin
working on di decorators
r109 throw new Error("The foo isn't set");
cin
Working on IoC container configuration
r111 return this._v;
cin
working on di decorators
r109 }
cin
tests moved under src/ folder...
r50 }