question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add the descendants option to ContentChild

See original GitHub issue

🚀 feature request

Relevant Package

@angular/core

Description

Similar but opposite to how the ContentChildren decorator has descendants option to query all descendants, I would like ContentChild to have an option to query only direct descendants.

Describe the solution you’d like

  1. Add descendants as a metadata property for ContentChild
  2. If descendants is true or undefined, query all descendants (preserves current behavior)
  3. If descendants is false, query only direct descendants

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
the-avid-engineercommented, Jun 24, 2021

It would be nice if the bot posted a link to the poll itself. I had no idea where to vote.

0reactions
angular-automatic-lock-bot[bot]commented, Aug 1, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ContentChildren - Angular
descendants - If true include all descendants of the element. If false then only query direct children of the element. emitDistinctChangesOnly - The...
Read more >
why {descendants: true} doesn't work in ContentChildren?
But purpose of { descendants: true } is used to select descendant children, which means the second MyCustomDirective in componentTwo should also ...
Read more >
66. The read & descendants in @ContentChild ... - YouTube
The read & descendants in @ ContentChild & @ ContentChildren are two beneficial options to aid in some complex scenarios. In this 2nd...
Read more >
ContentChild and ContentChildren in Angular - TekTutorialsHub
The ContentChild & ContentChildren are decorators, which we use to ... It does not have the static option but has the descendants option...
Read more >
Angular - ContentChildren
Any time a child element is added, removed, or moved, the query list will be ... selector - the directive type or the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found