When using flex-layout ContentChildren is unavailable
I've noticed that when Im using flex-layout inside a component's content the ContentChildren QueryList is empty when the directive is removed everything works normally. I've created a plunker with the example
@phmello - very odd bug. And when I do this:
<parent-component fxLayout="column">
<child-component></child-component>
<child-component></child-component>
<child-component></child-component>
</parent-component>
all works great. Yet when part of content-projection, it does not work :
<parent-component>
<div fxLayout="column">
<child-component></child-component>
<child-component></child-component>
<child-component></child-component>
</div>
</parent-component>
@phmello - this is not an issue with Flex-Layout.
@ContentChildren() by default only queries top-level elements. But you can specify additional options to query for all descendents in the projected content:
@ContentChildren(ChildComponent, {descendants: true}) children: QueryList<ChildComponent>;
See this working Plunker here.
Closing this issue as not-an-issue.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.