Title: Problem when adding dynamically a component with g[test] selector in SVG · Issue #10404 · angular/angular · GitHub
Open Graph Title: Problem when adding dynamically a component with g[test] selector in SVG · Issue #10404 · angular/angular
X Title: Problem when adding dynamically a component with g[test] selector in SVG · Issue #10404 · angular/angular
Description: I'm submitting a ... (check one with "x") [ x ] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question Current ...
Open Graph Description: I'm submitting a ... (check one with "x") [ x ] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/...
X Description: I'm submitting a ... (check one with "x") [ x ] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angu...
Opengraph URL: https://github.com/angular/angular/issues/10404
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Problem when adding dynamically a component with g[test] selector in SVG","articleBody":"**I'm submitting a ...** (check one with \"x\")\n\n[ x ] bug report\n[ ] 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**Current behavior**\n\nI try to add dynamically this component within SVG:\n\n```\n@Component({\n selector: 'g[test1]',\n template: `\n \u003csvg:text x=\"10\" y=\"15\" fill=\"red\">I love SVG!\u003c/svg:text>\n `\n})\nexport class Test1Comp {\n}\n```\n\nI use this approach:\n\n```\nthis.resolver.resolveComponent(Test1Comp).then((factory:ComponentFactory\u003cany>) => {\n this.cmpRef = this.viewContainerRef.createComponent(factory);\n});\n```\n\nWhereas the corresponding content is added to the DOM, it appears that the host element (`g`) isn't a valid SVG element (perhaps the svg namespace isn't used):\n\n```\n\u003cg test1> \u003c!-- UnkownHTMLElement--> \n \u003ctext>...\u003c/text> \u003c!-- SVGTextElement -->\n\u003c/g>\n```\n\nThis prevents from displaying the SVG elements within the `g` one.\n\n**Expected/desired behavior**\n\nTo be able to add dynamically components within SVG with selectors like `g[test1]`.\n\n**Reproduction of the problem**\n\nSee this plunkr: http://plnkr.co/edit/6aLGnLNi0svLk4CVS9M2?p=preview.\n\n**What is the expected behavior?**\n\nI expect the added host element to be an `SVGElement` and not an `HTMLUnknownElement`.\n\n**What is the motivation / use case for changing the behavior?**\n\n**Please tell us about your environment:**\n- **Angular version:** 2.0.0-rc.4\n- **Browser:** [Chrome] \n- **Language:** [ TypeScript ] \n","author":{"url":"https://github.com/templth","@type":"Person","name":"templth"},"datePublished":"2016-07-30T12:27:51Z","url":"https://github.com/angular/angular/issues/10404"}
| 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:485992e5-0da0-33b1-9339-12f747715622 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B368:1D20B7:F066A4:12F7455:6B014491 |
| html-safe-nonce | 882037f20fb82b33a8a535b33c1af606b946f4d5547dea6e34a8dde35a827aa2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzY4OjFEMjBCNzpGMDY2QTQ6MTJGNzQ1NTo2QjAxNDQ5MSIsInZpc2l0b3JfaWQiOiI0MDIwODA2MDgzNDUzOTk0MTI5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fceb98aac0591f73f655e2021209138b8dc0a1ba54849d433c391884ff148b50 |
| hovercard-subject-tag | issue:168465163 |
| 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/10404/issue_layout |
| twitter:image | https://opengraph.githubassets.com/34e803ad144c5afa9a3e2997b09ace6b7c6c476d719227bf1bd7c439a3722ee6/angular/angular/issues/10404 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/34e803ad144c5afa9a3e2997b09ace6b7c6c476d719227bf1bd7c439a3722ee6/angular/angular/issues/10404 |
| og:image:alt | I'm submitting a ... (check one with "x") [ x ] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | templth |
| 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