AngularJS ng-readonly Directive
The ng-readonly directive sets the readonly attribute of a form field. If the ng-readonly returns true, then the form field will be readonly. It is necessary as it is more flexible than a simple readonly attribute as we can change its value from true to false and vice versa. It is used in input and textarea.
Syntax:-
< input ng-readonly="expression" >< /input >
Further Explanation:-
ValueDescription expressionAn expression that will set the element readonly attribute if it returns true.