Rick
Rick

Reputation: 1880

Angular & svg - Can't find any SVG tags for angular

Has anyone tried using an svg with angular? I have successfully used them with angularJS, but I can't seem to find any way to use them in Angular.

In AngularJS I am able to do this:

<svg ng-x={{svg.x}} ng-y={{svg.y}} ng-attr-view_box="{{svg.viewBox}}">
<path ng-attr-d="{{svg.path}}"/>
</svg>

But none of those tags seem to work on angular. any ideas??

Upvotes: 0

Views: 68

Answers (2)

Rick
Rick

Reputation: 1880

ok I figured it out: [attr.viewBox]="svg.viewBox"

Upvotes: 1

jasonvuriker
jasonvuriker

Reputation: 275

In Angular attribute binding is like [attr.disabled] = "", [attr.attribute-name]=""

Upvotes: 1

Related Questions