AngularJS ng-disabled
Directive
AngularJS Example
Disable or enable an input field:
Disable form input fields: <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>
Definition and Usage
The ng-disabled directive sets the disabled attribute of a form input field (input, select, or textarea).
If the expression inside ng-disabled
returns true, the form field will be disabled.
Syntax
<input>, <select>, and <textarea> elements support this directive.
Parameter Values
Value | Description |
---|---|
expression | If the expression returns true, the disabled attribute is added to the element. |