My:

Check all

My:

Check all

Easy Tutorial
❮ Ng Ng Include Ng Ng Model Options ❯

AngularJS ng-checked Directive

AngularJS Reference Manual


AngularJS Example

Select one or select all options:

<body ng-app=""><p>My:</p><input type="checkbox" 
   ng-model="all"> Check all<br><br><input type="checkbox" 
   ng-checked="all">Volvo<br><input type="checkbox" 
   ng-checked="all">Ford<br><input type="checkbox" 
   ng-checked="all">Mercedes</body>

Definition and Usage

The ng-checked directive is used to set the checked attribute of a checkbox or radio button.

If the ng-checked attribute returns true, the checkbox or radio button will be selected.


Syntax

Supported on <input> elements with type checkbox or radio.


Parameter Values

Value Description
expression If it returns true, the element option will be selected.

AngularJS Reference Manual

❮ Ng Ng Include Ng Ng Model Options ❯