-
Notifications
You must be signed in to change notification settings - Fork 713
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
lazyInject decorator not working with RequestScope #1073
Comments
|
I have it working with my own decorator instead of the decorator from inversify-inject-decorators. It is not ready for a pull request yet, for example because it doesn't support Named and Tagged services yet. Let me know of you are interested. |
@allardmuis I'm currently facing this same problem, can I get you to share the work you've done on this issue? |
I'm also facing this issue |
+1 |
@allardmuis, can you share your code? |
The lazyInject decorator appears to be a replacement for the constructor-injection. But the scoping rules don't work with lazy injection.
Expected Behavior
The 'lazyInject' decorator should inject the same instance when the binding is done in RequestScope.
Current Behavior
See this example code for an illustration:
The problem is that the lazyInject decorator uses
container.get
itself, creating a new request scope for every resolution.The text was updated successfully, but these errors were encountered: