New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVG child element does not render without svg namespace #7216
Comments
I have the same problem. I would also expect non-prefixed elements to work. |
I experienced the same issue, when writing reusable D3 components to handle data visualizations that are nestable within parent components, which already contain an A couple of comments to add on though. When writing the D3 reusable as an Angular 2 attribute directive, the described issue does not occur, i.e. the namespace prefixing is not necessary. In this scenario, I can accomplish all the DOM rendering with D3 after grabbing the injected So back to trying the same with an Angular 2 component. When considering styles for the component, something peculiar happens. The styles are ignored within the DOM inserted with the attribute selector component. However, "forcing them down" works. I.e. having the following in the component stylesheet unexpectedly fails to apply:
Forcing it down with a deep selector works:
Oddly enough, applying the host selector also works??? In an awkward way it seems
|
The prefix is the only way we can know if it is an svg element when there is no parent. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
#1632 describes that it is possible to have SVG child elements via an attribute selector.
So I expected the following to work. However, it does not render the circle:
I get it working by adding the SVG namespace but this works counter-intuitive in my opinion:
plnkr
The text was updated successfully, but these errors were encountered: