form control set value code example
Example 1: reactive form programmatically set value
this.formRef.patchValue({
field: value1,
field2: value2,
/* ... */
});
Example 2: get formcontrol value
this.loginForm = new FormGroup({
'email': new FormControl('', { validators: [Validators.required] })
});
// get like this
const { email } = this.loginForm.value;