-
Notifications
You must be signed in to change notification settings - Fork 556
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
Component-level injectors don't work #1622
Comments
Any progress on this one? |
I'll check it during this week but not sure if I would find a proper fix, the order of creation field component and its wrappers has been changed and we can't revert it. |
Like a workaround for franzeal/ngx-formly-tabs#2 it can be made with providing TabsetService in the module directly instead of component, I tried and it works fine. |
You can provide it on the container component. The drawback is that you cant have more than one tabset in the form... |
@franzeal the fix should be landed in
|
@aitboudad that works to an extent, certainly enough that I can address the issue on my end. Wanting to keep the usage consistent, I was surprised to see that it won't work if I change both to types: |
I think I've got an idea to make it work, let me check it first :) |
@franzeal in |
@aitboudad I really appreciate it, thank you! |
I'm submitting a ...
Current behavior
In version 5, component-level injectors do not work.
Expected behavior
Component-level injectors should work.
Minimal reproduction of the problem with instructions
Below is a demonstration of component-level injectors. I'm demonstrating a parent/child relationship of wrappers (A) and components (B) (these don't behave differently, which is expected). In the console, each parent/child logs its service dependency. The expectation is that all parent/child log output should have the service, but in the v5 demo the children receive null.
https://stackblitz.com/edit/ngx-formly-ui-bootstrap-component-injectors-v3 (works)
https://stackblitz.com/edit/ngx-formly-ui-bootstrap-component-injectors-v4 (works)
https://stackblitz.com/edit/ngx-formly-ui-bootstrap-component-injectors-v5 (issue)
What is the motivation / use case for changing the behavior?
Trying to address: franzeal/ngx-formly-tabs#2
Angular version:
Tested with Angular 6 and 7.
Browser:
Chrome 75, Firefox 67
The text was updated successfully, but these errors were encountered: