-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Preserve attributes camelcased #9845
Comments
this is a reasonable request, I think. The thing is that it makes it really hard to normalize the attribute name. |
I don't think it should break any apps though, it's just another step towards "first class SVG elements", and HTML attributes are case insensitive anyways, so it should be okay. |
Looking at this page, it makes you realize how many attributes are affected. |
One solution could be to store a hash of attributes with key-value pairs being Here is a simple plunker that outputs the object you can use to inspect with: The attributes object on the DOM node can be used to find the case insensitive version of the attribute. |
as discussed, we can just have an encoding scheme for ngAttr and use for example underscore to denote camelcasing. so |
SVG attributes are case sensitive and some have upper case letters in them This change ensures that we can identify these, when being used with the `ng-attr` directive, by encoding upper case letters with a preceding underscore. For example to apply `ng-attr` to the `viewBox` attribute we could write `ng-attr-view_box` - or any of the other variants: `ng:attr:view_box`, `data-ng-attr-view_box`, etc. Closes #9845 Closes #10194
cf http://stackoverflow.com/questions/24910730/how-to-handle-patterntransform-using-ng-attr-keep-it-camelcased
In short Id like
ng-attr-patternTransform
to producepatternTransform
(instead ofpatterntransform
currently).It's a common problem if you are dealing with svg elements.
The viewBox attribute is another common case.
The text was updated successfully, but these errors were encountered: