René's URL Explorer Experiment


Title: ContentChildren doesn't get children created with NgTemplateOutlet · Issue #14842 · angular/angular · GitHub

Open Graph Title: ContentChildren doesn't get children created with NgTemplateOutlet · Issue #14842 · angular/angular

X Title: ContentChildren doesn't get children created with NgTemplateOutlet · Issue #14842 · angular/angular

Description: Original title: ViewChildren doesn't get children created with NgTemplateOutlet Please see comments below... I'm submitting a ... [x] bug report Current behavior When you use ngTemplateOutlet to render a template passing by input propert...

Open Graph Description: Original title: ViewChildren doesn't get children created with NgTemplateOutlet Please see comments below... I'm submitting a ... [x] bug report Current behavior When you use ngTemplateOutlet to re...

X Description: Original title: ViewChildren doesn't get children created with NgTemplateOutlet Please see comments below... I'm submitting a ... [x] bug report Current behavior When you use ngTemplateOutl...

Opengraph URL: https://github.com/angular/angular/issues/14842

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ContentChildren doesn't get children created with NgTemplateOutlet","articleBody":"Original title: *ViewChildren doesn't get children created with NgTemplateOutlet*\r\n\r\n**Please see comments below...**\r\n\r\n**I'm submitting a ...**\r\n```\r\n[x] bug report\r\n```\r\n\r\n**Current behavior**\r\nWhen you use ngTemplateOutlet to render a template passing by input property ViewChildren don't get or don't find in the redered elements.\r\n\r\n**Expected behavior**\r\nI think ViewChildren should get the elements rendered by ngTemplateOutlet.\r\n\r\n**Minimal reproduction of the problem with instructions**\r\nIn this [plunkr](https://plnkr.co/edit/BHZHcVKuhoP8OzQHIxAR?p=info), on app.ts file, you can see a `Child` component and a `Parent` component, Parent component has an input property called `template1`, this accept a TemplateRef that is rendered using ngTemplateOutlet. `Parent` component has a `ViewChildren` collection to get the `Child` components and shows the length of this collection in the end of template.\r\n\r\nWell, using this component this way:\r\n\r\n```` html\r\n    \u003cng-template #template1>\r\n        \u003cchild>\u003c/child>\r\n        \u003cchild>\u003c/child>\r\n    \u003c/ng-template>\r\n    \u003cparent [template1]=\"template1\">\u003c/parent>\r\n````\r\n\r\nThe `Parent` component render the two `Child` components but the length of ViewChildren collection is 0. You can uncomment the line 16 of app.ts file to include a static `\u003cchild/>` component in the `Parent` template. Then the collection length is 1.\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\nIt's would be very useful to pass template to components, rows of grids, lines of lists, ...\r\nIn the other hand I have this [plunkr](https://plnkr.co/edit/wFvjrJjNYBLx5sYnJRhm?p=preview) in this case I am rendering `Child` components using a `ngFor`, ViewChildren works fine.\r\nSince both, ngTemplateOutlet and ngForOf, using `viewContainerRef.createEmbeddedView` to render the templates ... why works with ngFor and not with ngTemplateOutlet?\r\nI think that the only reason is that `Child` components come from different component context, but I would like to know it.\r\n\r\n**Please tell us about your environment:**\r\nWindows 10, VisualStudioCode, npm, lite-server\r\n\r\n* **Angular version:** 4.0.0-rc2\r\n\r\n* **Browser:** [all]\r\n \r\n* **Language:** [TypeScript 2.2.1]\r\n","author":{"url":"https://github.com/tolemac","@type":"Person","name":"tolemac"},"datePublished":"2017-03-01T20:14:13Z","url":"https://github.com/angular/angular/issues/14842"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:29fb4954-ef4e-2034-775d-5bafef15dc23
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCF7A:A71F9:D20F15:107EB14:6B013A31
html-safe-nonceed919f71306b3768a01480865a1998491e9631241d33561f6a396594d71301de
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjdBOkE3MUY5OkQyMEYxNToxMDdFQjE0OjZCMDEzQTMxIiwidmlzaXRvcl9pZCI6IjMzOTA4NTYyNDIyMzc4ODA4ODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacafefbd527bf6b4a43e18545f84613054ce920a789feb73b14108bb7d784b2e93
hovercard-subject-tagissue:211194920
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/14842/issue_layout
twitter:imagehttps://opengraph.githubassets.com/739f596dac7d118779a93f99223167a2488d4678a4ef16bc5853da260568acb1/angular/angular/issues/14842
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/739f596dac7d118779a93f99223167a2488d4678a4ef16bc5853da260568acb1/angular/angular/issues/14842
og:image:altOriginal title: ViewChildren doesn't get children created with NgTemplateOutlet Please see comments below... I'm submitting a ... [x] bug report Current behavior When you use ngTemplateOutlet to re...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametolemac
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/14842#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F14842
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F14842
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/14842
Reloadhttps://github.com/angular/angular/issues/14842
Reloadhttps://github.com/angular/angular/issues/14842
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/14842
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/14842
ContentChildren doesn't get children created with NgTemplateOutlethttps://github.com/angular/angular/issues/14842#top
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenthttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P3%22
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: querieshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20queries%22
type: use-casehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20use-case%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/tolemac
tolemachttps://github.com/tolemac
on Mar 1, 2017https://github.com/angular/angular/issues/14842#issue-211194920
plunkrhttps://plnkr.co/edit/BHZHcVKuhoP8OzQHIxAR?p=info
plunkrhttps://plnkr.co/edit/wFvjrJjNYBLx5sYnJRhm?p=preview
Nexthttps://github.com/angular/angular/issues/14842?timeline_page=1
https://github.com/tolemac
tolemachttps://github.com/tolemac
on Mar 2, 2017https://github.com/angular/angular/issues/14842#issuecomment-283636328
https://github.com/tolemac
tolemachttps://github.com/tolemac
on Mar 3, 2017https://github.com/angular/angular/issues/14842#issuecomment-283886683
Q1http://stackoverflow.com/questions/39258258/detecting-when-a-child-is-added-dynamically
Q2http://stackoverflow.com/questions/42529802/how-to-get-works-viewchildren-with-ngtemplateoutlet-4-0-0-rc1
IgorMinarhttps://github.com/IgorMinar
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
on Mar 13, 2017https://github.com/angular/angular/issues/14842#event-998064150
IgorMinarhttps://github.com/IgorMinar
4.0.0-blockershttps://github.com/angular/angular/milestone/72
on Mar 13, 2017https://github.com/angular/angular/issues/14842#event-998064204
https://github.com/tbosch
tboschhttps://github.com/tbosch
on Mar 14, 2017https://github.com/angular/angular/issues/14842#issuecomment-286515566
https://github.com/tolemac
tolemachttps://github.com/tolemac
on Mar 14, 2017https://github.com/angular/angular/issues/14842#issuecomment-286573499
tboschhttps://github.com/tbosch
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
severity3: brokenhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
on Mar 14, 2017https://github.com/angular/angular/issues/14842#event-999970455
tboschhttps://github.com/tbosch
on Mar 14, 2017https://github.com/angular/angular/issues/14842#event-999970501
https://github.com/tbosch
tboschhttps://github.com/tbosch
on Mar 14, 2017https://github.com/angular/angular/issues/14842#issuecomment-286585214
#15117https://github.com/angular/angular/issues/15117
https://github.com/csisy-bt4w
csisy-bt4whttps://github.com/csisy-bt4w
on Jun 10, 2024https://github.com/angular/angular/issues/14842#issuecomment-2157717705
this stackblitzhttps://stackblitz.com/edit/stackblitz-starters-uh4fsx?file=src%2Fmain.ts
@pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
https://github.com/keatkeat87
keatkeat87https://github.com/keatkeat87
on Jun 11, 2024https://github.com/angular/angular/issues/14842#issuecomment-2160789516
@csisy-bt4whttps://github.com/csisy-bt4w
https://github.com/csisy-bt4w
csisy-bt4whttps://github.com/csisy-bt4w
on Jun 11, 2024https://github.com/angular/angular/issues/14842#issuecomment-2160894236
https://github.com/keatkeat87
keatkeat87https://github.com/keatkeat87
on Jun 12, 2024https://github.com/angular/angular/issues/14842#issuecomment-2162126575
posthttps://www.cnblogs.com/keatkeat/p/17944102#:~:text=%E5%BD%93%20ng%2Dtemplate%20%E9%81%87%E4%B8%8A%C2%A0Query%20Elements
https://github.com/SEWOBEDEFELICE
SEWOBEDEFELICEhttps://github.com/SEWOBEDEFELICE
on Oct 22, 2024https://github.com/angular/angular/issues/14842#issuecomment-2429116787
https://github.com/ilyakonrad
ilyakonradhttps://github.com/ilyakonrad
on Oct 31, 2024https://github.com/angular/angular/issues/14842#issuecomment-2449773636
https://github.com/Schmitda
Schmitdahttps://github.com/Schmitda
on Nov 7, 2024https://github.com/angular/angular/issues/14842#issuecomment-2462675101
https://github.com/MurhafSousli
MurhafSouslihttps://github.com/MurhafSousli
on Feb 20, 2025https://github.com/angular/angular/issues/14842#issuecomment-2672785674
https://github.com/montella1507
montella1507https://github.com/montella1507
on May 5, 2025https://github.com/angular/angular/issues/14842#issuecomment-2851303142
https://github.com/waterplea
waterpleahttps://github.com/waterplea
on May 5, 2025https://github.com/angular/angular/issues/14842#issuecomment-2851424211
atscotthttps://github.com/atscott
ng-content component in router-outlet #12447https://github.com/angular/angular/issues/12447
on Jul 28, 2025https://github.com/angular/angular/issues/14842#event-18844546377
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Jan 8, 2026https://github.com/angular/angular/issues/14842#issuecomment-3721564047
JeanMechehttps://github.com/JeanMeche
duplicatehttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Aduplicate
Canonical: Content Projection #64504https://github.com/angular/angular/issues/64504
on Jan 8, 2026https://github.com/angular/angular/issues/14842#event-21911796384
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Feb 8, 2026https://github.com/angular/angular/issues/14842#issuecomment-3865816791
automatic conversation locking policyhttps://github.com/angular/angular/blob/f0fbced1c55bc8b8ed9df01cea99df42f3e7eae3/contributing-docs/auto-issue-locking.md
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Feb 8, 2026https://github.com/angular/angular/issues/14842#event-22617004849
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/14842
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/14842
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenthttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P3%22
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: querieshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20queries%22
type: use-casehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20use-case%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.