-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create typescript injector and data binding utils using decorators #43
Comments
branch created: #43_implementDecorators |
try refactoring the
Then refactor If this is not possible create a new decorator called @Injectable that will add the code to the target. Also see if there is someway to use the injector to map interfaces. Something like:
This is the last real piece missing as in general you always inject into interface types to avoid restricting yourself to a single inheritance chain. What I am finding is that the use of decorators adds a fairly substantial amount of code to your libs. As such I would probably not recommend the use of declarative and opt for the imperative use of |
I was not able to overwrite the constructor within @Inject due to the fact the object's constructor was already defined at that stage. This required me to create the |
I was not able to use Also, we cannot map injections to interface definitions. They are dropped by default in the exported lib since they serve no real purpose outside of typescript compiler checking.
|
Feature/#43 implement decorators
You can use decorators to do DI, scopes, etc. Info on how to build decorators is here: http://blog.wolksoftware.com/decorators-metadata-reflection-in-typescript-from-novice-to-expert-part-4
Better yet there is an IOC framework for typekit. See if you can extend it to provide the decorators for DI in typescript and hook up to function overrides that will work with Lotus injector and scopes. Framework is here: https://www.npmjs.com/package/typescript-ioc
I'd like to include an @bindable decorator that will mixin subject if the object does not extend it, and add the notify call to the setter. See if we could also use @bindable on a public property replacing the public property with a private one, and adding the accessor methods.
The text was updated successfully, but these errors were encountered: