Within the controller, I defined a scope variable: $scope.readOnly = true
. In the HTML code:
<select ng-if="readOnly" ng-model="readOnly" required>
<option value="true" selected>True</option>
<option value="false">False</option>
</select>
<select ng-if="!readOnly" ng-model="readOnly" required>
<option value="true">True</option>
<option value="false" selected>False</option>
</select>
<button ng-click="save()"> Save</button>
However, there seems to be an issue with this setup. When clicking on save, the result is undefined. How can I fix this problem?