问题
I am writing a simple library using TypeScript (not using angular). I need to use a DI framework in this library. I checked out the DI framework in Angular2, but this seems like an overkill and I need to wrap my whole library in an Angular module which I don't want to do.
回答1:
I don't use DI in TypeScript/ES6 for production (yet) because they are not yet finalized.
For experimenting, I used needlepoint which was at the time I was using ES6.
But for typescript, typescript-ioc looks like it's a better candidate. It has both IOC and DI.
来源:https://stackoverflow.com/questions/41971364/typescript-dependency-injection-framework