There is a checkbox being used in the code snippet below:
<input type="checkbox" ng-click="toggleShowOtherUserConfiguration()"
ng-model="showOtherUserConfiguration"
name="ShowOtherUserConfiguration"
value="showOtherUserConfiguration" />
In the app.controller, the following setting has been established:
$scope.showOtherUserConfiguration = false;
The intention is for the checkbox to always display as false
when the page loads.
However, the current behavior observed is as follows:
Upon loading the page, even though the value of
$scope.showOtherUserConfiguration
is false
, the checkbox remains unchecked.
When the checkbox is manually checked, its value still displays as false
.
If the checkbox status is changed from checked to unchecked, then the value of
$scope.showOtherUserConfiguration
changes to true
.
Your advice is sought on how to ensure that
$scope.showOtherUserConfiguration
stays as false
when the checkbox is unchecked and true
when it is checked.
Please note: Do not make any changes within the
toggleShowOtherUserConfiguration()
function except for modifying the $scope.showOtherUserConfiguration
value.