Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Why it returns just one SVGElement? #161

Open
bogacg opened this issue Feb 8, 2021 · 1 comment
Open

Why it returns just one SVGElement? #161

bogacg opened this issue Feb 8, 2021 · 1 comment

Comments

@bogacg
Copy link

bogacg commented Feb 8, 2021

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?

@arkon
Copy link
Owner

arkon commented Feb 8, 2021

That wasn't an expected use case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants