ng-inline-svg
ng-inline-svg copied to clipboard
Why it returns just one SVGElement?
Instead of HTML element I did use inlineSVG
with a SVG element:
<svg [inlineSVG]="'assets/shapes.svg'" [onSVGLoaded]="handleSVG" >
</svg>
and I'd expect this still works when I manipulate contents of read SVG file in onSVGLoaded
like stripping out root element:
handleSVG(svgEl: SVGElement){
// console.log(svgEl)
return svgEl.querySelectorAll('svg>*');
}
but it fails. It accepts only one element to be written back to template (SVG root element or in my case I group read elements and put them in a group element then return).
Why is that so? Is this a SVG / Js requirement or because this library don't expect an implementation as the above one?
That wasn't an expected use case.