I'm building a custom AngularJS directive to create a google map, and I've stored some of the google map options in custom attributes within my tag:
<googlemap zoom-control="true" …></googlemap>
Angular's directive compile method has parameters (tElement, tAttrs, transclude)
; when I log tAttrs
to the console, the object has properties with names that have converted hyphens to camelCase:
Who is doing this—Angular or the browser (checked in Firefox & Chrome)? Can I rely on this behaviour?
P.S. When I check the DOM, the attributes of the html element still have hyphens.
ng:bind
vsng-bind
vsdata-ng-bind
but I didn't realise Angular would convert the attribute names into json-friendly names. btw, i'm using that service and it's working just fine (but I would like to see if I can do it the "Angular way"). – Braud