formgroup controls set value code example
Example 1: formgroup addcontrol
let form: FormGroup = new FormGroup({});
form.addControl(field_name, new FormControl('', Validators.required));
Example 2: angular formgroup on value change
this.reactiveForm.get("firstname").valueChanges.subscribe(x => {
console.log('firstname value changed')
console.log(x)
})