my checkbox and radio button implementation:
<input id="{{k.group_name}}_{{i}}" name="{{k.group_name}}" type="checkbox" class="hide" name="{{k.group_name}}" [value]="m.details" (change)="change($event, m , k.item_ingredient_group_key,false,k.maximum)">
Similarly for radio button:
<input id="{{k.group_name}}_{{i}}" type="radio" class="hide" name="{{k.group_name}}" [value]="m.details" (change)="change($event, m , k.item_ingredient_group_key,true,k.maximum)">
Within my json service, I retrieve either is_selected = true
or is_selected = false
based on the JSON data provided.
The value of is_selected
needs to be updated accordingly.
For checkboxes, I have used binding with [(ngModel)]="is_selected"
, which works as expected. However, when it comes to radio buttons, the updating of values does not function similarly to checkboxes.
There seems to be a discrepancy in how the true and false values are managed between the two types of input elements.