angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

ng-attr-class and class attributes don't interpolate in SVG elements (v1.2.0rc1)

Open alexandrosm opened this issue 13 years ago • 10 comments

This worked in 1.1.5 but not in 1.2.0rc1

So, this works: http://plnkr.co/edit/mYTOyhhGIbbafjtyyk9z?p=preview whereas this doesnt: http://plnkr.co/edit/b74nUKpU2WLdU50738ms?p=preview

alexandrosm avatar Aug 14 '13 10:08 alexandrosm

Git bisect says this test case broke with commit f2dfa8916f8ed855d55187f5400c4c2566ce9a1b

will investigate further and update here

alexandrosm avatar Aug 14 '13 11:08 alexandrosm

Class is read-only on SVG elements. http://www.w3.org/TR/SVG/types.html#__svg__SVGStylable__className

jafp avatar Aug 14 '13 13:08 jafp

Thanks for the input jafp.

I'm not sure I understand though. Are you saying this was changed on purpose to comply with the standard? The commit doesn't mention anything to this effect.

Chrome doesn't have an issue with editing class attributes on SVG elements (which is why 1.1.5 works).

But even so, the second approach of putting the data in ng-attr-class should have worked, since the class attribute is written only once.

alexandrosm avatar Aug 14 '13 13:08 alexandrosm

This is pretty annoying. downgraded to 1.1.5 for now. Could someone from angular team clarify this issue, please?

aziz avatar Aug 22 '13 15:08 aziz

current snapshot still doesn't work http://plnkr.co/edit/p4cPlEfkMPTDUFIX8fP9?p=preview

alexandrosm avatar Aug 30 '13 10:08 alexandrosm

Not sure if this is the same issue or if i should open another one, but there seems to be a few bugs around interpolating inside attributes for specific html element. e.g. works but