Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

AngularJS ng-disabled Directive

AngularJS ng-disabled Instruction

AngularJS Reference Manual AngularJS Reference Manual


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

<

/select

Try 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 AngularJS Reference Manual