1234567891011121314151617181920212223242526 |
- import { Inject, Singleton } from "../../src/Decorator";
- import {ComponentA} from "./ComponentA"
- import {IComponentB} from "./ComponentB"
-
- @Singleton()
- export class TestComponent{
-
- @Inject(IComponentB)
- private compoenntB: IComponentB
-
- @Inject(ComponentA)
- private componentA: ComponentA
-
- getFromA(): string{
- return this.componentA.getFromThis()
- }
-
- getAThroughB(): string{
- return this.compoenntB.getFromA()
- }
-
- getFromB():string{
- return this.compoenntB.getFromThis()
- }
-
- }
|