ng-inline-svg icon indicating copy to clipboard operation
ng-inline-svg copied to clipboard

Why it returns just one SVGElement?

Open bogacg opened this issue 3 years ago • 1 comments

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?

bogacg avatar Feb 08 '21 19:02 bogacg

That wasn't an expected use case.

arkon avatar Feb 08 '21 20:02 arkon