Title: Angular 17 New Control Flow | Allow more than one node at root @if, @else, @for, etc · Issue #53677 · angular/angular · GitHub
Open Graph Title: Angular 17 New Control Flow | Allow more than one node at root @if, @else, @for, etc · Issue #53677 · angular/angular
X Title: Angular 17 New Control Flow | Allow more than one node at root @if, @else, @for, etc · Issue #53677 · angular/angular
Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Allow multiple child nodes inside new control flow like bellow
Open Graph Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Allow multiple child nodes inside new control flow like bellow X Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Allow multiple child nodes inside new control flow like bellow <app-box> @if (selected === 'fish&...
Opengraph URL: https://github.com/angular/angular/issues/53677
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular 17 New Control Flow | Allow more than one node at root @if, @else, @for, etc","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\n\ncore\n\n### Description\n\nAllow multiple child nodes inside new control flow like bellow\r\n\r\n```html\r\n\u003capp-box>\r\n @if (selected === 'fish'){\r\n \u003cspan header> Fish \u003c/span>\r\n \u003cspan main> 🐟 🐡 🐙 🐠 \u003c/span>\r\n } @else {\r\n \u003cspan header> Mammals \u003c/span>\r\n \u003cspan main> 🦍 🐅 🦬 🐫 \u003c/span>\r\n }\r\n\u003c/app-box>\r\n```\r\n\r\nwithout throwing bellow error\r\n\r\nNode matches the \"[header]\" slot of the \"BoxComponent\" component, but will not be projected into the specific slot because the surrounding @if has more than one node at its root. To project the node in the right slot, you can:\r\n\r\n1. Wrap the content of the @if block in an \u003cng-container/> that matches the \"[header]\" selector.\r\n2. Split the content of the @if block across multiple @if blocks such that each one only has a single projectable node at its root.\r\n3. Remove all content from the @if block, except for the node being projected.\r\n\r\nThis check can be disabled using the `extendedDiagnostics.checks.controlFlowPreventingContentProjection = \"suppress\" compiler option.`\n\n### Proposed solution\n\nMake bellow snippet work\r\n\r\n```html\r\n\u003capp-box>\r\n @if (selected === 'fish'){\r\n \u003cspan header> Fish \u003c/span>\r\n \u003cspan main> 🐟 🐡 🐙 🐠 \u003c/span>\r\n } @else {\r\n \u003cspan header> Mammals \u003c/span>\r\n \u003cspan main> 🦍 🐅 🦬 🐫 \u003c/span>\r\n }\r\n\u003c/app-box>\r\n```\n\n### Alternatives considered\n\nSince I am using projections I have to use multiple @if \r\n\r\n```html\r\n\u003capp-box>\r\n@if (selected === 'fish'){\r\n \u003cspan header> Fish \u003c/span>\r\n} \r\n@if (selected === 'mammals'){\r\n \u003cspan header> Mammals \u003c/span>\r\n}\r\n@if (selected === 'fish'){\r\n \u003cspan main> 🐟 🐡 🐙 🐠 \u003c/span>\r\n}\r\n@if (selected === 'mammals'){\r\n \u003cspan main> 🦍 🐅 🦬 🐫 \u003c/span>\r\n}\r\n\u003c/app-box>\r\n```\r\n\r\nbut this approach is a pain in the *ss, more verbose and less readable","author":{"url":"https://github.com/WarGreyGon","@type":"Person","name":"WarGreyGon"},"datePublished":"2023-12-21T15:01:22Z","url":"https://github.com/angular/angular/issues/53677"}
react-profiling 0 react-import-map react,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-controller voltron_issues_fragments route-action issue_layout fetch-nonce v2:c92530d6-00aa-ec53-c8b5-f1f12ad36be8 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id D542:1F2D:BC771F:ED912E:6B0130FB html-safe-nonce b8c5725ceb96e93b199b41f1aa667af207501fc9aa1ba0ecdbb7db03b7a6d16b visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTQyOjFGMkQ6QkM3NzFGOkVEOTEyRTo2QjAxMzBGQiIsInZpc2l0b3JfaWQiOiIyNDY1MTg5OTgyNzcyNDc0MTA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= visitor-hmac 7cb763deb33a5f55675f8c054e248b54a141fdef08165786116bc1499be7423f hovercard-subject-tag issue:2052587521 github-keyboard-shortcuts repository,issues,copilot google-site-verification Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I octolytics-url https://collector.github.com/github/collect analytics-location / fb:app_id 1401488693436528 apple-itunes-app app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/53677/issue_layout twitter:image https://opengraph.githubassets.com/b0990862d70040ef88f169804a6868107e8c45e9e85c23f5ff3fc6064be99515/angular/angular/issues/53677 twitter:card summary_large_image og:image https://opengraph.githubassets.com/b0990862d70040ef88f169804a6868107e8c45e9e85c23f5ff3fc6064be99515/angular/angular/issues/53677 og:image:alt Which @angular/* package(s) are relevant/related to the feature request? core Description Allow multiple child nodes inside new control flow like bellow og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username WarGreyGon hostname github.com expected-hostname github.com None cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c turbo-cache-control no-preview go-import github.com/angular/angular git https://github.com/angular/angular.git octolytics-dimension-user_id 139426 octolytics-dimension-user_login angular octolytics-dimension-repository_id 24195339 octolytics-dimension-repository_nwo angular/angular octolytics-dimension-repository_public true octolytics-dimension-repository_is_fork false octolytics-dimension-repository_network_root_id 24195339 octolytics-dimension-repository_network_root_nwo angular/angular turbo-body-classes logged-out env-production page-responsive disable-turbo false browser-stats-url https://api.github.com/_private/browser/stats browser-errors-url https://api.github.com/_private/browser/errors release 8c77c9e8439031ad54c75a250694842892f693e1 ui-target canary-2 theme-color #1e2327 color-scheme light dark react-app-name issues
URLs of crawlers that visited me.