English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script> </head> <body ng-app=""> Check the checkbox to set the input box to read-only:<input type="checkbox" ng-model="all"><br> <br> <input type="text" ng-readonly="all"> </body> </html>Test and See ‹/›
ng-readonly This directive is used to set the readonly attribute of the form field (input or textarea).
If ng-readonly If the expression of the attribute returns true, the form field is read-only.
<input ng-readonly="expression"></input>
The <input> and <textarea> elements support this directive.
Value | Description |
---|---|
expression | If the expression returns true, the form field is read-only. |