Title: ng-content default content · Issue #12530 · angular/angular · GitHub
Open Graph Title: ng-content default content · Issue #12530 · angular/angular
X Title: ng-content default content · Issue #12530 · angular/angular
Description: I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/an...
Open Graph Description: I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request...
X Description: I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not su...
Opengraph URL: https://github.com/angular/angular/issues/12530
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ng-content default content","articleBody":"**I'm submitting a ...** (check one with \"x\")\n\n```\n[ ] bug report => search github for a similar issue or PR before submitting\n[x] feature request\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\n```\n\n**Current behavior**\nWhen you add something inside a ng-content tag you get an error message: \u003cng-content> element cannot have content.\n\n**Expected behavior**\nShould render the html inside the ng-content tag as a default if no content was given. \n\n**Minimal reproduction of the problem with instructions**\nCreate a component that uses ng-content somewhere. Put some html inside, that should be rendered when nothing else is 'injected' there from outside. Then use the component somewhere else. \n\n**What is the motivation / use case for changing the behavior?**\nIn some cases you need a default behavior that can be replaced. In my case its an app header that shows the logo. When you navigate to a sub-page the logo will be replaced by a back button. It feels strange to add something like an input property to hide or show the logo. Some default content for ng content placeholders would feel much more intuitive.\n\n**Please tell us about your environment:**\nWin10, Angular CLI beta 18, VS Code\n- **Angular version:** 2.1.0\n 2.1.0\n- **Browser:** \n All\n- **Language:**\n TS\n- **Node (for AoT issues):** `node --version` = \n","author":{"url":"https://github.com/mbeckenbach","@type":"Person","name":"mbeckenbach"},"datePublished":"2016-10-25T22:03:44Z","url":"https://github.com/angular/angular/issues/12530"}
| 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:b71c1f65-f852-85dd-50e2-a0665c8490d3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9968:22DB35:DCCE0A:11CB52F:6B00F632 |
| html-safe-nonce | b61e28fed0527470ca43f89ce9591be8c7ec2f3f3a9fd5b1efde13bfc07df7ff |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTY4OjIyREIzNTpEQ0NFMEE6MTFDQjUyRjo2QjAwRjYzMiIsInZpc2l0b3JfaWQiOiIyMzEyNjI1MDI2MzYyMzA4MTQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b94e72c55d2fbf2dcc98f382db6ff71d527aad133652516e278d3b23670c6f6f |
| hovercard-subject-tag | issue:185246319 |
| 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/12530/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7e161b4b52f9df9f87722cc91b6ab42bfbbb53ab00e315d157c23a47f4b0fea6/angular/angular/issues/12530 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7e161b4b52f9df9f87722cc91b6ab42bfbbb53ab00e315d157c23a47f4b0fea6/angular/angular/issues/12530 |
| og:image:alt | I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mbeckenbach |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width