Topic: Angular - Validation on Init
Hi,
¿Is there a way to trigger and show input validation messages (data-error="" data-success="") when the components inits?
i've tried: updateValueAndValidity() function and the input validity state is updated correctly, but correct/error messages are not shown.
Any solutions?
Thank you.
Add comment
Arkadiusz Idzikowski staff answered 6 years ago
Dear Chulos,
You can try to mark your form controls as touched in ngOnInit like this:
this.yourFormControl.controls.yourControlName.markAsTouched();
Best,
Arek
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Answered
Specification of the issue
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No