Title: Enhance `ViewContainerRef.createComponent` to cater for SVG elements and beyond · Issue #66893 · angular/angular · GitHub
Open Graph Title: Enhance `ViewContainerRef.createComponent` to cater for SVG elements and beyond · Issue #66893 · angular/angular
X Title: Enhance `ViewContainerRef.createComponent` to cater for SVG elements and beyond · Issue #66893 · angular/angular
Description: Which @angular/* package(s) are relevant/related to the feature request? core Description I already know there are threads already open on this issue, and I wanted to touch base on it as it has been placed on the back burner. ViewContain...
Open Graph Description: Which @angular/* package(s) are relevant/related to the feature request? core Description I already know there are threads already open on this issue, and I wanted to touch base on it as it has bee...
X Description: Which @angular/* package(s) are relevant/related to the feature request? core Description I already know there are threads already open on this issue, and I wanted to touch base on it as it has bee...
Opengraph URL: https://github.com/angular/angular/issues/66893
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enhance `ViewContainerRef.createComponent` to cater for SVG elements and beyond","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\n\ncore\n\n### Description\n\nI already know there are threads already open on this issue, and I wanted to touch base on it as it has been placed on the back burner.\n\n`ViewContainerRef.createComponent` creates a component with `svg` in its selector correctly. For example, a component with selector `svg.some-class` is created in the correct namespace (see `namespaceURI`):\n\n\u003cimg width=\"471\" height=\"476\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/4b0f6872-139d-4ad1-bbb6-54c6d1699cd2\" />\n\nHowever, any child `path`, `g`, etc are not created in the correct namespace when done using `ViewContainerRef.createComponent` (see `namespaceURI`):\n\n\u003cimg width=\"471\" height=\"476\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/985779f6-2d6a-43f1-be4d-1ccd7eaa7b1e\" />\n\n### Proposed solution\n\nAs I see it, the neatest solution would be either to:\n\n1) allow `ViewContainerRef.createComponent` to accept a `hostElement` parameter, just as `createComponent` does, or\n2) make `ViewContainerRef.createComponent` accept a `nameSpace` parameter, or\n3) allow a `nameSpace` field in the `@Component` decorator.\n\nI would by far prefer 1, as this would allow dynamic selection of the component's host node. This would extend beyond this case - for example, a button component can be attached to either an `a` or `button` element dynamically.\n\n### Alternatives considered\n\nNone.","author":{"url":"https://github.com/davidbusuttil","@type":"Person","name":"davidbusuttil"},"datePublished":"2026-02-03T20:39:45Z","url":"https://github.com/angular/angular/issues/66893"}
| 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:d81e0a6b-eeea-b5fd-cc14-9283db4b848b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D870:14ECB:1A0A0D7:210FD13:6B014A3A |
| html-safe-nonce | 6664bd3fc5e1c9d8dbe43acbc1fb677d110d5f1db41242e4ebadf8b99da35298 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODcwOjE0RUNCOjFBMEEwRDc6MjEwRkQxMzo2QjAxNEEzQSIsInZpc2l0b3JfaWQiOiIxMzAwODY5MDUwODQ2NDk3MzM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | baeede9541d33da6e782352810586a8e56d8192e8ef5b30ee591a266719ea697 |
| hovercard-subject-tag | issue:3893115649 |
| 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/66893/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c0cc01836532006e9f7449406ba3baedaee13b96bb28e8bb2d6ebd1bbb9c7648/angular/angular/issues/66893 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c0cc01836532006e9f7449406ba3baedaee13b96bb28e8bb2d6ebd1bbb9c7648/angular/angular/issues/66893 |
| og:image:alt | Which @angular/* package(s) are relevant/related to the feature request? core Description I already know there are threads already open on this issue, and I wanted to touch base on it as it has bee... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | davidbusuttil |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width