12345678910111213141516171819202122232425262728 |
- import { Inject, Singleton } from "../../src/Decorator"
- import { Initializable } from "../../src/Interfaces"
- import { COMPONENT_B_VALUE, COMPONENT_C_VALUE } from "../CONSTANTS"
- import { ComponentA } from "./ComponentA"
-
- export abstract class IComponentC{
- getFromA: () => string
- getFromThis: () => string
- }
-
- @Singleton({
- interface: IComponentC,
- })
- export class ComponentC implements IComponentC{
-
- @Inject(ComponentA)
- private componentA: ComponentA
-
- private value: string = COMPONENT_C_VALUE
-
- getFromA(): string {
- return this.componentA.getFromThis()
- }
-
- getFromThis(): string {
- return this.value
- }
- }
|