I want to have false value when user checkbox is not checked.
HTML Code
On checking the checkbox value is setting as 'true' in addUser.isAllOrgSelected. But when checkbox is not checked value is not getting set to 'false'.
<input type="checkbox" id="checkbox-1-1" class="regular-checkbox"
ng-true-value="true" ng-false-value="false" ng-
model="addUser.isAllOrgSelected">
<label for="checkbox-1-1"></label>
<span class="check-text">ALL</span>
you can use the ng-checked
directive.
<input type="checkbox"
ng-model="addUser.isAllOrgSelected"
ng-true-value="true"
ng-false-value="false"
ng-checked="addUser.isAllOrgSelected " />
see example here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With