question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Routing breaks SVG rendering

See original GitHub issue

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Updates sugessted by @vicb

Current behavior When using the component router the svg inside a template does not render correctly, in this case the text and path is not shown.

Expected/desired behavior Should show a rendered svg text like: https://developer.mozilla.org/de/docs/Web/SVG/Element/textPath codepen

Reproduction of the problem Minimal none working plunker With routing-outlet

Minimal working plunker when router outlet it commented out at line [66-71] in app.ts commented out routing-outlet

What is the expected behavior? When using the component router with a router-outlet the SVG stops rendering correctly. The issue here ist that the SVG path and textpath does not have coordinates .

What is the motivation / use case for changing the behavior? Create an svg with with the Angular framework and use D3 only as layout engine.

Please tell us about your environment:

  • Angular version: 2.0.0-rc.X
  • Browser: [ Chrome XX | Firefox XX ]
  • Language: [ TypeScript ]

Old description Reproduction of the problem Starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).

Using the provided plunker the svg renders correctly: http://plnkr.co/edit/QTC26b1KRSbLinutw6D0?p=preview

Using the router example from the docs ROUTING & NAVIGATION and adding the svg snippet to app/app.component.ts then the rendering of the svg breaks: http://plnkr.co/edit/KPzL8CeQ3K8k5CLr3yE6?p=preview

When removing the router completely then the rendering works again: http://plnkr.co/edit/wyhPaJHl1i2rNrXfD57h?p=preview

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
zoechicommented, Sep 7, 2016

Have you tried to configure <base href="..."> so that it works with SVG and configure the router by providing APP_BASE_HREF?

0reactions
angular-automatic-lock-bot[bot]commented, Sep 15, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

svg is not properly rendering when navigate route in safari ...
My problem is that SVG is not rendering properly when url has some route like 'localhost/hello' in Safari. In Chrome, Working fine.
Read more >
Here's How I Solved a Weird Bug Using Tried and True ...
At first, this looks like a CSS issue. Some styles might be applied on a hover event that breaks the layout or the...
Read more >
0 breaks all future Opacity: 1 SVG Elements and they don't ...
Issue 363736: 1st SVG Element with Opacity: 0 breaks all future Opacity: 1 SVG Elements and they don't render. · 1. Extract the...
Read more >
A challenger to the throne of vector graphics. SVG is dead ...
(middle) My TinyVG software renderer output; (right) The TinyVG data rendered as SVG again. There are tiny differences in the files, but overall ......
Read more >
SVG and CSS to style polygons | ArcGIS API for JavaScript 3.29
SVG and CSS to style polygons ... Not supported in browsers that do not support SVG. ... else if (tableAttr >= classbreaks[0].value &&...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found