I have a form with Checkbox and I want to dynamically check based on the database. It doesn’t work properly using ng-checked or ng-model. Then I figured out its working as expected while setting ng-true-value strictly.
Generally, possible to set the value to ng-false-value & ng-true-value as number and as well string.
Example: ng-false-value=0, ng-true-value=1
To make it strict, Use the constant expression
Example: ng-false-value=”’0’”, ng-true-value=”’1’”
$scope.checkbox = 1;
Now if you look at this checkbox will be checked by default.
The post ng-checked is not working appeared first on Drtuts.