feat: add error handling for skill form validation
This commit is contained in:
parent
6119621040
commit
703d644799
5 changed files with 41 additions and 3 deletions
|
@ -104,7 +104,7 @@ export class MitarbeiterFormComponent {
|
|||
Object.keys(this.mitarbeiterForm.controls).forEach(field => {
|
||||
const control = this.mitarbeiterForm.get(field);
|
||||
|
||||
if (control && control.errors && control.touched) {
|
||||
if (control && control.errors) {
|
||||
this.errorMessages[field] = Object.keys(control.errors)
|
||||
.map(errorKey => this.validationErrorMessages[errorKey] || `Unknown error: ${errorKey}`)
|
||||
.join(' ');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue