Skip to content
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

loopback/context does not inject arguments to constructor of decorated class #2946

Closed
checkmatez opened this issue May 23, 2019 · 4 comments
Closed
Assignees

Comments

@checkmatez
Copy link

Description / Steps to reproduce / Feature proposal

loopback/context does not inject arguments to constructor of decorated class.
Repro: https://codesandbox.io/embed/loopbackcontext-bug-with-decorator-zdedp

Current Behavior

Dependencies doesn't not get injected.

Expected Behavior

Dependencies get injected.

This was introduced with 8c0bdb6#diff-c1d762637c20a39c3e01ff4c7d440f03R307
Relevant issue: #1565

This prevents using class properties in custom decorators, since Typescript moves them to implicit constructor, so class.toString() will contain constructor and will match against regular expression. Also this is really hacky way :)

Not sure what the fix would be...

@dhmlau
Copy link
Member

dhmlau commented May 24, 2019

@raymondfeng, could you please help? Thanks.

@raymondfeng
Copy link
Contributor

@checkmatez Interesting. I'll investigate.

@dhmlau
Copy link
Member

dhmlau commented May 27, 2019

@checkmatez @raymondfeng , with the PR #2954 landed, is this issue good to close?

@checkmatez
Copy link
Author

Looks good, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants