angularjs ng-disabled directive

angularjs example

Disable or enable the input box:

<! Doctype html>
<meta charset="utf-8">
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
<body ng-app="">
<input type="text" ng-disabled="all">
<input type="radio" ng-disabled="all">
<select ng-disabled="all">

Definition and usage

The ng-disabled directive sets the disabled attribute (input, select, or textarea) of a form input field.

If the expression in ng-disabled returns true, the form fields will be disabled.


<input ng-disabled="expression"></input>

The<input> ;,<select> ;, and<textarea>elements all support this directive.

Parameter value

value description
expression If the expression returns true, set the element to add the disabled attribute.

  • Previous Detailed usage of XUtils3 framework in Android (1)
  • Next jQuery get and set the height of the iframe