Skip to main content
Improved answer
Source Link
Niladri Basu
  • 10.7k
  • 7
  • 59
  • 65

If you are using reactive form you can achieve this programmatically like this (one-by-one approach):

 this.formGroupName.controls[controlNmae].disable();

Eg: this.formGroupName.controls['lastName'].disable()

To disable all at once:

this.formGroupName.disable()

In your case do: this.leaseholderForm.disable()
And to turn it back do: this.leaseholderForm.enable()

What you can do is create a function like this and call it after you have called createLeaseholderForm():

disableForm() {
 this.leaseholderForm.disable()
}  

   

for more info read this.

If you are using reactive form you can achieve this programmatically like this (one-by-one approach):

 this.formGroupName.controls[controlNmae].disable();

Eg: this.formGroupName.controls['lastName'].disable()

To disable all at once:

this.formGroupName.disable()

In your case do: this.leaseholderForm.disable()
And to turn it back do: this.leaseholderForm.enable()

for more info read this.

If you are using reactive form you can achieve this programmatically like this (one-by-one approach):

 this.formGroupName.controls[controlNmae].disable();

Eg: this.formGroupName.controls['lastName'].disable()

To disable all at once:

this.formGroupName.disable()

In your case do: this.leaseholderForm.disable()
And to turn it back do: this.leaseholderForm.enable()

What you can do is create a function like this and call it after you have called createLeaseholderForm():

disableForm() {
 this.leaseholderForm.disable()
}  

   

for more info read this.

Improved format
Source Link
Niladri Basu
  • 10.7k
  • 7
  • 59
  • 65

If you are using reactive form you can achieve this programmatically like this (one-by-one approach):

 this.formGroupName.controls[controlNmae].disable();

Eg: this.formGroupName.controls['lastName'].disable()

To disable all at once:

this.formGroupName.disable()

In your case do: this.leaseholderForm.disable()
And to turn it back do: this.leaseholderForm.enable()

for more info read this.

If you are using reactive form you can achieve this programmatically like this:

 this.formGroupName.controls[controlNmae].disable();

To disable all at once:

this.formGroupName.disable()

In your case do: this.leaseholderForm.disable()
And to turn it back do: this.leaseholderForm.enable()

for more info read this.

If you are using reactive form you can achieve this programmatically like this (one-by-one approach):

 this.formGroupName.controls[controlNmae].disable();

Eg: this.formGroupName.controls['lastName'].disable()

To disable all at once:

this.formGroupName.disable()

In your case do: this.leaseholderForm.disable()
And to turn it back do: this.leaseholderForm.enable()

for more info read this.

Improved format
Source Link
Niladri Basu
  • 10.7k
  • 7
  • 59
  • 65

If you are using reactive form you can achieve this programmatically like this:

 this.formGroupName.controls[controlNmae].disable();

To disable all at once:

this.formGroupName.disable()

In your case do: this.leaseholderForm.disable() and
And to turn it back do: this.leaseholderForm.enable()

for more info read this.

If you are using reactive form you can achieve this programmatically like this:

 this.formGroupName.controls[controlNmae].disable();

To disable all at once:

this.formGroupName.disable()

In your case do: this.leaseholderForm.disable() and to turn it back do: this.leaseholderForm.enable()

If you are using reactive form you can achieve this programmatically like this:

 this.formGroupName.controls[controlNmae].disable();

To disable all at once:

this.formGroupName.disable()

In your case do: this.leaseholderForm.disable()
And to turn it back do: this.leaseholderForm.enable()

for more info read this.

Source Link
Niladri Basu
  • 10.7k
  • 7
  • 59
  • 65
Loading