Permalink
3 comments
on commit
sign in to comment.
Browse files
feat($compile): add support for ng-attr with camelCased attributes
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
- Loading branch information
Showing
with
49 additions
and 3 deletions.
- +9 −0 docs/content/guide/directive.ngdoc
- +4 −1 src/ng/compile.js
- +36 −2 test/ng/compileSpec.js
This comment has been minimized.
Hi, this was in the 1.5.5 release right? That's the version I'm using (based on other dependencies), and I couldn't get this to work. Tried to set
ng-attr-start_offset="{{offset}}"on an SVG element and it still came out all lowercase.This comment has been minimized.
@KingKarrow it was actually released in 1.3.7 but it still appears in 1.5.5 and it works.
See http://plnkr.co/edit/7JiR9hxHju40omQmJLkS?p=preview
This comment has been minimized.
Okay, cool. At least I know it -should- work with our version. Thanks!