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 764B

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