I've come across similar questions multiple times, and while I've explored various solutions, none seem to work in my case...
html file:
<input id="sampleA" name="try" type="radio" data-ng-model="$ctrl.isSampleA" value="true" data-ng-change="$ctrl.update()"></input>
<label for="sampleA">Sample A</label>
<input id="sampleB" name="try" type="radio" data-ng-model="$ctrl.isSampleA" value="false" data-ng-change="$ctrl.update()"></input>
<label for="sampleB">Sample B</label>
js file:
//Initialization:
vm.isSampleA = false;
//This function returns the correct boolean value returned by API
vm.update = function() {
vm.isSampleA = response.rows["0"].sampleA;
};
To briefly explain the situation: Initially, 'Sample B' is checked by default. The user then selects 'Sample A' and sends the updated value to the REST API, where it updates correctly. However, when attempting to edit the form again:
Expected: 'Sample A' should be checked
Actual: Neither of the 2 options are checked, even though the value of 'isSampleA' is true.