Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

AngularJS ng-readonly Directive

AngularJS ng-readonly Instruction

AngularJS Reference Manual AngularJS Reference Manual


AngularJS Examples

Set the input field to read-only:

Readonly:

<

input

type=

"checkbox"

ng-model=

"all"

<

br

<

input

type=

"text"

ng-readonly=

"all"

Try it »


Definition and Usage

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

If both the ng-readonly If the expression of the attribute returns true, the form field is read-only.


Syntax

<

input

ng-readonly=

"expression"

<

/input


Parameter value

Value Description
expression If the expression returns true, the form field is read-only.

AngularJS Reference Manual AngularJS Reference Manual