Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

@ContentChildren(typeOrString, descendants: true) doesn't work #195

@zoechi

Description

@zoechi

@ContentChildren() doesn't work when the elements were passed through 2 components

<grand-parent>
    <child></child>
    <child></child>
</grand-parent>

Where <grand-parent> looks like

<parent>
  <ng-content></ng-content>
</parent>

and <parent> like

<ng-content></ng-content>

I want to query the children from the ParentComponent

the children are displayed where they are expected, just

@ContentChildren(ChildComponent, descendants: true) QueryList<ChildComponent> children;

doesn't work (with or without descendants: true)

When I use ParentComponent like

<parent>
    <child></child>
    <child></child>
</parent>

The ContentChildren() query works fine.

I combined parent and child into one component and this work as well (with only one <ng-content> level) .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions