mench / dependency-injection-es6

MIT License
16 stars 1 forks source link

inject with constructor #1

Closed devmondo closed 7 years ago

devmondo commented 7 years ago

Hi, can we add the @inject decorator on constructor of the class instead of on a property?

thanks in advanced.

mench commented 7 years ago

Hi thanks for your feedback.
It can be done but I think it will cause contradiction issue with dependency injection pattern

devmondo commented 7 years ago

thanks for the prompt reply,

many frameworks do it https://github.com/lgvo/di-decorators https://github.com/aurelia/dependency-injection

i like yours because it is really small code :)

mench commented 7 years ago

Ok I agree with you :) I will add this feature and will update it soon. Thanks a lot.

devmondo commented 7 years ago

hahaha, thank you man, i did not mean to push it :)

devmondo commented 7 years ago

working perfectly thank you :)