WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

AngularJS ng-readonly Directive


Example

Make the info field readonly:

Readonly: <input type="checkbox" ng-model="all">
<br>
<input type="text" ng-readonly="all">
Try it yourself »

Definition and Usage

The ng-readonly order sets the readonly property of a structure field (input or textarea).

The structure field will be readonly if the articulation inside the ng-readonly property returns true.

The ng-readonly order is important to almost certainly move the esteem between true and false. In HTML, you can't set the readonly credit to false (the nearness of the readonly characteristic makes the component readonly, paying little respect to it's value).


Syntax

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

Supported by <input> <textarea> elements.


Parameter Values

Value Description
expression An articulation that will set the component's readonly quality on the off chance that it returns true.