angular form controlr valuechange code example
Example 1: angular formgroup on value change
this.reactiveForm.get("firstname").valueChanges.subscribe(x => {
console.log('firstname value changed')
console.log(x)
})
Example 2: get formcontrol value
this.loginForm = new FormGroup({
'email': new FormControl('', { validators: [Validators.required] })
});
// get like this
const { email } = this.loginForm.value;