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
For all HTML elements that support the value attribute, Angular also provides the ngValue attribute, which allows binding non-string expressions to the value of a form element.
Cashmere's hc-radio-button is not a native HTML element, but the presence of the value field might lead Angular devs to expect that it also supports ngValue and that they work in the same way. This isn't true. When you try to use it, it silently fails: the attribute doesn't do anything and you don't see any console errors.
The value field on HcRadioButton supports any kind of data, not just strings, so ngValue isn't necessary. Still, it's an easy and automatic trap to fall into.
Reproduction
Steps to reproduce:
Use [ngValue] instead of [value] on an hc-radio-button.
Additional context
Related: #969, #963, #779 - it looks like we've previously addressed this with hc-select.
The text was updated successfully, but these errors were encountered:
Summary
For all HTML elements that support the
value
attribute, Angular also provides thengValue
attribute, which allows binding non-string expressions to the value of a form element.Cashmere's hc-radio-button is not a native HTML element, but the presence of the
value
field might lead Angular devs to expect that it also supportsngValue
and that they work in the same way. This isn't true. When you try to use it, it silently fails: the attribute doesn't do anything and you don't see any console errors.The
value
field on HcRadioButton supports any kind of data, not just strings, songValue
isn't necessary. Still, it's an easy and automatic trap to fall into.Reproduction
Steps to reproduce:
[ngValue]
instead of[value]
on an hc-radio-button.Additional context
Related: #969, #963, #779 - it looks like we've previously addressed this with hc-select.
The text was updated successfully, but these errors were encountered: