1To set all FormGroup values use, setValue:
2
3this.myFormGroup.setValue({
4 formControlName1: myValue1,
5 formControlName2: myValue2
6});
7To set only some values, use patchValue:
8
9this.myFormGroup.patchValue({
10 formControlName1: myValue1,
11 // formControlName2: myValue2 (can be omitted)
12});
1this.reactiveForm.get("firstname").valueChanges.subscribe(x => {
2 console.log('firstname value changed')
3 console.log(x)
4})