![]() |
VOOZH | about |
The ng-checked Directive in AngularJS is used to read the checked or unchecked state of the checkbox or radio button to true or false. If the expression inside the ng-checked attribute returns true then the checkbox/radio button will be checked otherwise it will be unchecked.
Syntax:
<input type="checkbox|radio" ng-checked="expression"> Contents... </input>
If the expression returns true then the element's checked attribute will be checked.
Example: This example uses the ng-checked Directive to select the checkbox and return the all selected checkbox value.
Output:
Example: This example describes the ng-checked Directive to check & uncheck all at once.
Output: