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

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