'How to set min validator if input value is less than min value?
I am trying to set min validator on formControl while initializing the control. but the thing is if the default input value is 10 and if we set Validators.min(15) then it's throwing ExpressionChangedAfterItHasBeenCheckedError.
This is the code snippet -
ngOnInit(){
// the default value is 10
this.fb.control(this.defaultValue, [Validators.min(15)]);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
