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
Bug? ContentChild not working with nested directives. #10121
Comments
According to the docs |
@DzmitryShylovich
|
It is the expected behavior, you can only query direct children. The rationale being that you might not know about inner component implementation and should not be affected by them. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
Consider this code:
plunker: http://plnkr.co/edit/mZdFvTVTFGO01DFnITZc?p=preview
I have 2 directives
target
andfindTarget
and I want to find if element withfindTagret
directive has a descendant withtarget
directive. This works when both directives are in the same template:but doesn't work if they are in different components.
Using ViewChild instead of ContentChild doesn't work in both cases.
Using Query doesn't work either.
Is this expected behaviour? If so, what is the proper way to do this?
The text was updated successfully, but these errors were encountered: