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

Evaluating Angular Logic #113

Closed nj-coder closed 5 years ago

nj-coder commented 5 years ago

Hi,

I have an svg file which needs some angular logic like routerLink, click etc. Is there a way that we can make this work as for now even if i modify svg to include (click)="clicked()", the function simply does not trigger.

arkon commented 5 years ago

tl;dr That isn't supported, nor will it be.

You should instead have the handler as part of the parent, actually Angular-bound element (i.e. whatever you're using the directive on). If you need it to be based on clicking a part of the SVG itself, get references to its elements manually.