Dependency Injection for Typescript
Lightweight wrap and extension of di.js for TypeScript.
Install
npm install di-ts
Usage
You need to use --emitDecoratorMetadata flag when compile you typescript files. "emitDecoratorMetadata" flag is supported by the 1.5 beta version of TypeScript.
car.ts
engine.ts
mockEngine.ts
main.ts
/// ;; //instantiate car, car.engine is magically instance of Engine! :) ;; //instantiate car, car.engine is instance of MockEngine! :)