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