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.

ComponentC.ts 582B

12345678910111213141516171819202122232425262728293031
  1. import { Inject, Singleton } from "../../src/Decorator"
  2. import { COMPONENT_C_VALUE } from "../CONSTANTS"
  3. import { ComponentA } from "./ComponentA"
  4. export class benis{
  5. }
  6. export abstract class IComponentC{
  7. getFromA: () => string
  8. getFromThis: () => string
  9. }
  10. @Singleton({
  11. interface: IComponentC,
  12. })
  13. export class ComponentC{
  14. @Inject(ComponentA)
  15. private componentA: ComponentA
  16. private value: string = COMPONENT_C_VALUE
  17. getFromA(): string {
  18. return this.componentA.getFromThis()
  19. }
  20. getFromThis(): string {
  21. return this.value
  22. }
  23. }