AngularJS ng-readonly directive
AngularJS instance
Set the input box to read-only:
<!DOCTYPE html><html><head><meta charset="utf-8"><script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script></head><body ng-app="">Tick the check box to set the input box to read-only: <input type="checkbox" ng-model="all"><br><br><input type="text" ng-readonly="all"></body></html>
Definition and usage
The ng-readonly directive is used to set the readonly property of a form field (input or textarea).
If the expression of the ng-readonly property returns true, the form field is read-only.
grammar
<input ng-readonly="expression"></input>
The <input> <textarea> element supports this directive.
Parameter value
| value | describe |
|---|---|
| Expression | If the expression returns true, the form field is read-only. |
The above is a compilation of AngularJS ng-readonly information. We will continue to add relevant information in the future. Thank you for your support for this website!