Closed nolazybits closed 6 years ago
Anyone can confirm or affirm what I have written please?
Hi @nolazybits . Sorry for the late response.
The problem is that typescript-ioc does not scan any folder looking for classes. Your classes must be previously imported. I updated the documentation to explain better this point and to show how you can tell the Container where to find your classes.
Please, take a look at this
Thank you much for the extra doc. I have used the bind method but will look into the addSource. Thanks again :+1:
Hi there,
So I used to add abstract class and implemetation in the same file and everything was sweet.. Now if I try to separate the definition to the implementation it fails
eg
afile.ts
will work fine whereas
ITest.ts
Test.ts
will still work but the object is going to be an empty object
{}
My guess is that nowhere in my code do I have a link to the Test.ts file, hence not loaded
What I want to achieve -> trying to have a really modular code base, and providing for instance an definition for a Logger but many implementation in a Library. Then the user could choose what implementation to use (ConsoleLogger, CloudwatchLogger, MultiLogger, ...). I guess then to be able to achieve this I need to use the
Container.bing(ITest).to(Test)
and won't be able to use decorator.Is that correct or is there a solution to my problem just using decorators?