You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TestComponent.ts 710B

123456789101112131415161718192021222324252627282930313233
  1. import { Inject, Singleton } from "../../src/Decorator";
  2. import {ComponentA} from "./ComponentA"
  3. import {IComponentB} from "./ComponentB"
  4. import { ComponentC } from "./ComponentC";
  5. @Singleton()
  6. export class TestComponent{
  7. @Inject(IComponentB)
  8. private compoenntB: IComponentB
  9. @Inject(ComponentA)
  10. private componentA: ComponentA
  11. @Inject(ComponentC)
  12. private componentC: ComponentC
  13. getFromA(): string{
  14. return this.componentA.getFromThis()
  15. }
  16. getAThroughB(): string{
  17. return this.compoenntB.getFromA()
  18. }
  19. getFromB():string{
  20. return this.compoenntB.getFromThis()
  21. }
  22. getFromC(): string{
  23. return this.componentC.getFromThis()
  24. }
  25. }