angular-svg-icon icon indicating copy to clipboard operation
angular-svg-icon copied to clipboard

svg icon classes/id conflicts

Open indraraj26 opened this issue 4 years ago • 4 comments

if you have same id in other svg then the second one will not display.

Is there anyway to force svg to have unique id (via encapsulation)

svg1: https://svgshare.com/i/_7P.svg svg2: https://svgshare.com/i/_6v.svg

indraraj26 avatar Aug 12 '21 12:08 indraraj26

No, see the open issue #73. Creating unique ids is a requested enhancement that I've not had time to implement as of yet.

czeckd avatar Aug 12 '21 15:08 czeckd

I checked #73 but still it is hacky way and you will have to do it for all svg which is quite lot of works.

Btw overall this is really great package. I appreciate your efforts to maintain this package.

I was also thinking how we can give unique id to path, g, clipath is also there. We might need to find the way to encapsulate each svg-icon component just like angular does it with viewEncapsulation.emulated or default

If you think this can be close feel free to do it.

indraraj26 avatar Aug 12 '21 18:08 indraraj26

@indraraj26 you can try this package: https://www.npmjs.com/package/ngx-svg-schematic

Teebo avatar Sep 20 '21 06:09 Teebo

You can save the svg's rather with unique classes names or inline styles, that would fix that problem

kuncevic avatar Apr 11 '22 08:04 kuncevic