Completed the migration work for angular version 12 after that I am facing an issue with valueChanges subscription. currently, valueChanges triggering when initiating the form. Check the code below.
Expected is valueChanges should not trigger when initiating the form.
form = new FormGroup({
name: new FormControl('', {
validators: [
Validators.required
],
updateOn: 'blur',
}),
description: new FormControl('', {
updateOn: 'blur'
})
});
Is this a regression?
No
Description
Completed the migration work for angular version 12 after that I am facing an issue with valueChanges subscription. currently, valueChanges triggering when initiating the form. Check the code below.
Expected is valueChanges should not trigger when initiating the form.
form = new FormGroup({ name: new FormControl('', { validators: [ Validators.required ], updateOn: 'blur', }), description: new FormControl('', { updateOn: 'blur' }) });
this.form.valueChanges .pipe( untilDestroyed(this), ).subscribe((data) => { if (this.form.valid) { console.log('trigger API'); } });
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/angular-ivy-ei4kz1?file=src%2Fapp%2Fapp.component.ts
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
Anything else?
No response
Do you want to create a pull request?
No