arkon / ng-inline-svg

[Inactive] Angular directive for inserting an SVG file inline within an element.
https://echeung.me/ng-inline-svg/
MIT License
210 stars 88 forks source link

removeSVGAttributes not working with SVG sprites #61

Closed jscti closed 6 years ago

jscti commented 6 years ago

Hi there

<!-- not working -->
<div class="tata" [removeSVGAttributes]="['fill']" [inlineSVG]="'assets/svg/sprite.svg#schema'"></div>
<!-- working -->
<div class="tata" [removeSVGAttributes]="['fill']" [inlineSVG]="'assets/svg/schema.svg'"></div>

[removeSVGAttributes]="['fill']" property works fine on a single .svg file. But on this same file encapsulated in a SVG sprite, the fill attributes are no longer removed.

Reproduced with any svg with fill attributes that are sprited with svg-sprite and the "symbol" option

Is this normal ? I understand that you can't overload these attributes on the "use" when loading normally a sprite in the browser, but i though this lib parsed & removed the attributes after svg download and befire insertion in the dom.

Thanks

arkon commented 6 years ago

Yeah, this is an oversight on my part. Will add in a future update.