You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnfunction($scope,$element,$attrs){varelement_data=$element.data();// gather all data attributes in one passconsole.log(element_data.foo_thing);// 'testing1'console.log(element_data.foo_other);// 'testing2'};
returnfunction($scope,$element,$attrs){varelement_data=$element.data();// gather all data attributes in one passconsole.log(element_data.foo_thing);// undefinedconsole.log(element_data.foo_other);// undefined// actual data, camelCasedconsole.log(element_data.fooThing);// testing1console.log(element_data.fooOther);// testing2};
It would be nice if the format of the data attributes were preserved.
The text was updated successfully, but these errors were encountered:
I'm in the process of converting some interpolated data attributes to use
bindonce
'sbo-attr-data*
and noticed something unexpected:Say there are data attributes written with underscores, which (I believe) is valid HTML:
So in the directive you can go:
When converting code like this to use
bindonce
'sbo-attr
, it is replacing underscores with dashes.Think it might be this line: https://github.com/Pasvaz/bindonce/blob/master/bindonce.js#L198
becomes
which results in:
It would be nice if the format of the data attributes were preserved.
The text was updated successfully, but these errors were encountered: