I'm using Angularjs and I have two radio buttons with the same name access and different model fields model.field1 and model.field2, so I need to update the model when selection change, initially model.field1 and model.field2 are set to false, and I want to set the model value to true when cheched and false when not checked, how can I do that?
<input type="radio" id="r1" data-ng-model="model.field1" name="access"><span>R 1</span>
<input type="radio" id="r2" data-ng-model="model.field2" name="access"><span>R 2</span>
I appreciate any help, thanks