How to make readonly all inputs in some div in Angular2? How to make readonly all inputs in some div in Angular2? typescript typescript

How to make readonly all inputs in some div in Angular2?


Try this in input field:

[readonly]="true"

Hope, this will work.


If you want to do a whole group, not just one field at a time, you can use the HTML5 <fieldset> tag.

<fieldset [disabled]="killfields ? 'disabled' : null">    <!-- fields go here --></fieldset>


If using reactive forms, you can also disable the entire form or any sub-set of controls in a FormGroup with myFormGroup.disable().