Implement error handling for the create qualification form #19
@ -47,9 +47,11 @@ export class CreateQualificationComponent {
|
||||
|
||||
getErrorMessage(fieldName: string): string {
|
||||
const field = this.qualificationForm.get(fieldName);
|
||||
|
||||
if (field?.errors?.['required']) {
|
||||
return 'This field is required';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user