AngularJS ng-disabled Instruction
AngularJS Examples
Disable or enable the input field:
Disable a form input field:
<
input
type=
"checkbox"
ng-model=
"all"
<
br
<
input
type=
"text"
ng-disabled=
"all"
<
input
type=
"radio"
ng-disabled=
"all"
<
select
ng-disabled=
"all"
<
option
Female
<
/option
<
option
Male
<
/option
<
/selectTry it »
Definition and Usage
ng-disabled The directive sets the disabled attribute of a form input field (input, select, or textarea).
If both the ng-disabled If the expression in returns true, the form field will be disabled.
Syntax
<
input
ng-disabled=
"expression"
<
/input,
Parameter value
| Value | Description |
|---|---|
| expression | If the expression returns true, the disabled attribute is added to the element. |
AngularJS Reference Manual