Disable FormGroup controls in Reactives FormModule in Angular2

Jeeten Parmar picture Jeeten Parmar · Feb 22, 2017 · Viewed 21.2k times · Source

I am using Reactive FormsModule in Angular2. Now, I want to disable all controls of FormGroup. I can use readOnly property in all controls but it is not better solution as we might add new fields in near future.

So, Is there anyway to disable FormGroup controls in short ?

Answer

developer033 picture developer033 · Feb 22, 2017

Now, I want to disable all controls of FormGroup

Use disable():

YOUR_FORM_GROUP.disable();

DEMO