René's URL Explorer Experiment


Title: ng-template gets rendered twice during hydration (when anchor comment node is not projected) · Issue #50543 · angular/angular · GitHub

Open Graph Title: ng-template gets rendered twice during hydration (when anchor comment node is not projected) · Issue #50543 · angular/angular

X Title: ng-template gets rendered twice during hydration (when anchor comment node is not projected) · Issue #50543 · angular/angular

Description: Which @angular/* package(s) are the source of the bug? platform-browser Is this a regression? No Description when hydration is enabled and a component uses ngTemplateOutlet to render a template passed from a parent e.g. via ContentChild ...

Open Graph Description: Which @angular/* package(s) are the source of the bug? platform-browser Is this a regression? No Description when hydration is enabled and a component uses ngTemplateOutlet to render a template pas...

X Description: Which @angular/* package(s) are the source of the bug? platform-browser Is this a regression? No Description when hydration is enabled and a component uses ngTemplateOutlet to render a template pas...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ng-template gets rendered twice during hydration (when anchor comment node is not projected)","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nplatform-browser\n\n### Is this a regression?\n\nNo\n\n### Description\n\nwhen hydration is enabled and a component uses `ngTemplateOutlet` to render a template passed from a parent e.g. via `ContentChild` then its getting rendered twice for the duration of the hydration.\r\n\r\nSo it looks the like this if 'abc' is the template content\r\nreceived from server\r\n`abc`\r\n\r\nduring hydration\r\n`abc abc` \u003c-- this looks sometimes a bit ugly\r\n\r\nafter hydration\r\n`abc`\r\n\r\nSo is it possible that the passed template gets just once rendered during the hydration process?\r\n\r\n\r\nThe relevant code parts for reprodruction:\r\n```\r\n\u003capp-shell>\r\n  \u003cng-template #customTemplate>\r\n    \u003cp>template\u003c/p>\r\n  \u003c/ng-template>\r\n\u003c/app-shell>\r\n```\r\n\r\n```\r\n@Component({\r\n  selector: 'app-shell',\r\n  template: `\u003cng-container\r\n    *ngIf=\"customTemplate\"\r\n    [ngTemplateOutlet]=\"customTemplate\"\r\n  >\u003c/ng-container>`,\r\n  styles: [],\r\n})\r\nexport class ShellComponent {\r\n  @ContentChild('customTemplate', { static: true })\r\n  customTemplate: TemplateRef\u003cany> | null = null;\r\n}\r\n\r\n```\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://github.com/michael-hein/hydration-ng-template\n\n### Please provide the exception or error you saw\n\n```true\nN/A\n```\n\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular CLI: 16.0.4        \r\nNode: 18.16.0\r\nPackage Manager: npm 8.19.3\r\nOS: win32 x64\r\n\r\nAngular: 16.0.4\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... platform-browser, platform-browser-dynamic, platform-server\r\n... router\r\n\r\nPackage                         Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect       0.1600.4\r\n@angular-devkit/build-angular   16.0.4\r\n@angular-devkit/core            16.0.4\r\n@angular-devkit/schematics      16.0.4\r\n@nguniversal/builders           16.0.2\r\n@nguniversal/express-engine     16.0.2\r\n@schematics/angular             16.0.4\r\nrxjs                            7.8.1\r\ntypescript                      4.9.5\n```\n\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/michael-hein","@type":"Person","name":"michael-hein"},"datePublished":"2023-06-01T21:03:07Z","url":"https://github.com/angular/angular/issues/50543"}

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:69331ba7-bdcb-75c8-281b-369855e097ce
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB1AE:10531B:815BA3:A4DAFD:6B0121D8
html-safe-noncef7fe11d3a4e1b0b42b481eddb359f5a4a3b07573e994428e8ec4648e22ba4d49
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMUFFOjEwNTMxQjo4MTVCQTM6QTREQUZEOjZCMDEyMUQ4IiwidmlzaXRvcl9pZCI6IjMyMTk4NTU5NTQ3NTM0Mjk5NzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc965d5b7b95c65ecaba50f5ee7c4bef839b7fd07406121c54360e9eb3dd3de71
hovercard-subject-tagissue:1737091586
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/50543/issue_layout
twitter:imagehttps://opengraph.githubassets.com/fff7aa5f54bb556338f952138f0c63c773a2cb393f8dc32b0b3bcd0b28e28efa/angular/angular/issues/50543
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fff7aa5f54bb556338f952138f0c63c773a2cb393f8dc32b0b3bcd0b28e28efa/angular/angular/issues/50543
og:image:altWhich @angular/* package(s) are the source of the bug? platform-browser Is this a regression? No Description when hydration is enabled and a component uses ngTemplateOutlet to render a template pas...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemichael-hein
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/50543#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F50543
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%2F50543
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/50543
Reloadhttps://github.com/angular/angular/issues/50543
Reloadhttps://github.com/angular/angular/issues/50543
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)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/50543
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/50543
ng-template gets rendered twice during hydration (when anchor comment node is not projected)https://github.com/angular/angular/issues/50543#top
https://github.com/thePunderWoman
https://github.com/AndrewKushnir
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: hydrationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20hydration%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/michael-hein
michael-heinhttps://github.com/michael-hein
on Jun 1, 2023https://github.com/angular/angular/issues/50543#issue-1737091586
https://github.com/michael-hein/hydration-ng-templatehttps://github.com/michael-hein/hydration-ng-template
Nexthttps://github.com/angular/angular/issues/50543?timeline_page=1
dylhunnhttps://github.com/dylhunn
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: hydrationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20hydration%22
on Jun 1, 2023https://github.com/angular/angular/issues/50543#event-9408293556
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Jun 1, 2023https://github.com/angular/angular/issues/50543#event-9408293700
https://github.com/dylhunn
dylhunnhttps://github.com/dylhunn
on Jun 1, 2023https://github.com/angular/angular/issues/50543#issuecomment-1572836556
@jessicajaniukhttps://github.com/jessicajaniuk
@AndrewKushnirhttps://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
jessicajaniukhttps://github.com/jessicajaniuk
on Jun 1, 2023https://github.com/angular/angular/issues/50543#event-9408355208
AndrewKushnirhttps://github.com/AndrewKushnir
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
on Jun 1, 2023https://github.com/angular/angular/issues/50543#event-9408608416
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
Backloghttps://github.com/angular/angular/milestone/82
on Jun 1, 2023https://github.com/angular/angular/issues/50543#event-9408608786
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Jun 1, 2023https://github.com/angular/angular/issues/50543#issuecomment-1572900259
@michael-heinhttps://github.com/michael-hein
AndrewKushnirhttps://github.com/AndrewKushnir
on Jun 1, 2023https://github.com/angular/angular/issues/50543#event-9408708437
https://github.com/michael-hein
michael-heinhttps://github.com/michael-hein
on Jun 2, 2023https://github.com/angular/angular/issues/50543#issuecomment-1573339782
https://github.com/CarlosTorrecillas
CarlosTorrecillashttps://github.com/CarlosTorrecillas
on Jun 19, 2023https://github.com/angular/angular/issues/50543#issuecomment-1596855691
@AndrewKushnirhttps://github.com/AndrewKushnir
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Jun 19, 2023https://github.com/angular/angular/issues/50543#issuecomment-1597522032
@CarlosTorrecillashttps://github.com/CarlosTorrecillas
https://github.com/jwittekind
jwittekindhttps://github.com/jwittekind
on Dec 6, 2024https://github.com/angular/angular/issues/50543#issuecomment-2522262208
https://github.com/tsteuwer-accesso
tsteuwer-accessohttps://github.com/tsteuwer-accesso
on Apr 30, 2025https://github.com/angular/angular/issues/50543#issuecomment-2841995934
https://github.com/artakvzn
artakvznhttps://github.com/artakvzn
on May 6, 2025https://github.com/angular/angular/issues/50543#issuecomment-2854728431
thePunderWomanhttps://github.com/thePunderWoman
on Jun 10, 2025https://github.com/angular/angular/issues/50543#event-18078971981
fix(core): Fixes template outlet hydrationhttps://github.com/thePunderWoman/angular/commit/29b43ff503bec7a0ba7417c96501caff95a12993
https://docs.github.com/articles/closing-issues-via-commit-messages
29b43ffhttps://github.com/thePunderWoman/angular/commit/29b43ff503bec7a0ba7417c96501caff95a12993
fix(core): Fixes template outlet hydrationhttps://github.com/thePunderWoman/angular/commit/2813f15bd802b39c44b6e8d6d8e52ec7e7b0b811
https://docs.github.com/articles/closing-issues-via-commit-messages
2813f15https://github.com/thePunderWoman/angular/commit/2813f15bd802b39c44b6e8d6d8e52ec7e7b0b811
fix(core): Fixes template outlet hydrationhttps://github.com/thePunderWoman/angular/commit/fe58cb16798eca13940204050a219965c4e1e9ca
https://docs.github.com/articles/closing-issues-via-commit-messages
fe58cb1https://github.com/thePunderWoman/angular/commit/fe58cb16798eca13940204050a219965c4e1e9ca
AndrewKushnirhttps://github.com/AndrewKushnir
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
on Jun 11, 2025https://github.com/angular/angular/issues/50543#event-18096596346
thePunderWomanhttps://github.com/thePunderWoman
on Jun 11, 2025https://github.com/angular/angular/issues/50543#event-18098688348
fix(core): Fixes template outlet hydrationhttps://github.com/thePunderWoman/angular/commit/2a45b55359103b6bf559e50e7692c6f75215a054
https://docs.github.com/articles/closing-issues-via-commit-messages
2a45b55https://github.com/thePunderWoman/angular/commit/2a45b55359103b6bf559e50e7692c6f75215a054
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
8424b3bhttps://github.com/angular/angular/commit/8424b3bcd5b9c78f37dc8ba636c87775937bcc03
on Jun 12, 2025https://github.com/angular/angular/issues/50543#event-18112742016
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
on Jun 12, 2025https://github.com/angular/angular/issues/50543#event-18112760135
fix(core): Fixes template outlet hydration (#62012)https://github.com/angular/angular/commit/e343cdfb86043e10d08aa4031b7b8d59342b37e5
#62012https://github.com/angular/angular/pull/62012
https://docs.github.com/articles/closing-issues-via-commit-messages
e343cdfhttps://github.com/angular/angular/commit/e343cdfb86043e10d08aa4031b7b8d59342b37e5
angular-robothttps://github.com/angular-robot
on Jun 12, 2025https://github.com/angular/angular/issues/50543#event-18112934360
fix(core): Fixes template outlet hydration (angular#61989)https://github.com/angular-robot/angular/commit/8424b3bcd5b9c78f37dc8ba636c87775937bcc03
angular#61989https://github.com/angular/angular/pull/61989
https://docs.github.com/articles/closing-issues-via-commit-messages
8424b3bhttps://github.com/angular-robot/angular/commit/8424b3bcd5b9c78f37dc8ba636c87775937bcc03
https://github.com/thePunderWoman
thePunderWomanhttps://github.com/thePunderWoman
on Jun 12, 2025https://github.com/angular/angular/issues/50543#issuecomment-2967486651
https://github.com/tsteuwer-accesso
tsteuwer-accessohttps://github.com/tsteuwer-accesso
on Jun 12, 2025https://github.com/angular/angular/issues/50543#issuecomment-2967635864
@thePunderWomanhttps://github.com/thePunderWoman
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Jul 13, 2025https://github.com/angular/angular/issues/50543#issuecomment-3066288883
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 Jul 13, 2025https://github.com/angular/angular/issues/50543#event-18602753218
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/50543
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/50543
AndrewKushnirhttps://github.com/AndrewKushnir
thePunderWomanhttps://github.com/thePunderWoman
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: hydrationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20hydration%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%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.