@ContentChildren not populating from parent <ng-content>
See original GitHub issue[*] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior @ContentChildren does not seem to work on Parent <ng-content> containers. Even if the ng-content is a child of the component.
Expected behavior I expect that ContentChildren is filled if it is a child of the component
Minimal reproduction of the problem with instructions https://plnkr.co/edit/J5itJmDfwKwtBsG6IveP?p=preview
Main HTML:
<div>
<child>
<test></test>
<test></test>
<test></test>
</child>
<br><br>
<parent>
<test></test>
<test></test>
<test></test>
</parent>
</div>
Child Component:
<h2>Child</h2>
<parent>
<ng-content></ng-content>
</parent>
Parent Component:
<h3>Parent</h3>
<ng-content></ng-content>
<div class='length'>Line count : {{length}}</div>
Please tell us about your environment: Windows, Angular4
Issue Analytics
- State:
- Created 6 years ago
- Reactions:38
- Comments:18 (3 by maintainers)
Top Results From Across the Web
Angular2 @ContentChildren not populated inside parent <ng ...
@ContentChildren does not seem to work on Parent <ng-content> containers. Even if the content is a child of the component.
Read more >This is how I finally understood Content Projection in Angular
Content Projection in simple words is giving a developer the power to insert content from a parent ComponentB into its child ComponentA.
Read more >ViewChildren & ContentChildren • Angular - codecraft.tv
We render in a tree down approach so when a parent component is getting constructed it means the children are not yet created....
Read more >Angular:3 ways you can pass templates from parent to child ...
Instead I would directly pass the html from parent to child component. Let's see how this works. Below is the gist of the...
Read more >Angular - Ovio.org
Tasks & Issues ; 18. 31. #16299. @ContentChildren not populating from parent <ng-content> · Small ; 12. 1. #36086. Service Worker "Quota exceeded"...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

bug is still open in angular 9 and 10 … please solve it
Any news on this?