Check out example codes for "formgroup angular". It will help you in understanding the concepts better.

Code Example 1

import { FormGroup } from '@angular/forms';
...
public main_form : FormGroup;
...
this.form = new FormGroup({});

Code Example 2

formgroup.get('controlname')
loginForm.get('username').valid && loginForm.get('username').touched

Code Example 3

/* 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
*/

Code Example 4

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)
});

Learn ReactJs, React Native from akashmittal.com