Q:

formgroup angular

To set all FormGroup values use, setValue:

this.myFormGroup.setValue({
  formControlName1: myValue1, 
  formControlName2: myValue2
});
To set only some values, use patchValue:

this.myFormGroup.patchValue({
  formControlName1: myValue1, 
  // formControlName2: myValue2 (can be omitted)
});
3
import { FormGroup } from '@angular/forms';
...
public main_form : FormGroup;
...
this.form = new FormGroup({});
2
/* Answer to: "" */

/*
  Reactive forms are built around observable streams, where form
  inputs and values are provided as streams of input values, which
  can be accessed synchronously. Reactive forms also provide a
  straightforward path to testing because you are assured that
  your data is consistent and predictable when requested.
  
  For more information go to:
  https://angular.io/guide/reactive-forms
*/
1

New to Communities?

Join the community