PhoneChannelDetailsComponent and MailChannelDetailsComponent implement a custom Validator to propagate the errors to the parent form control. Both components are instantiated in a switch statement. When switching between the forms a ExpressionChangedAfterItHasBeenCheckedError is thrown. This only happens in debug mode of Angular.
Bug Description
PhoneChannelDetailsComponent
andMailChannelDetailsComponent
implement a customValidator
to propagate the errors to the parent form control. Both components are instantiated in a switch statement. When switching between the forms aExpressionChangedAfterItHasBeenCheckedError
is thrown. This only happens in debug mode of Angular.This bug is already known since 2018 and has not been fixed yet: https://github.com/angular/angular/issues/23657
Expected Behavior
When switching between the two forms,
ExpressionChangedAfterItHasBeenCheckedError
should not be thrown in Angular debug mode.Steps to Reproduce
See bug description
Possible Solutions
Validator
into a@Directive
did not resolve the problemchangeDetection: ChangeDetectionStrategy.OnPush
in component definitionFurther Information
No response