refactor
This commit is contained in:
parent
326972938d
commit
12bebfe033
@ -6,6 +6,7 @@ import {NgIf} from "@angular/common";
|
|||||||
import {MatError, MatFormField, MatLabel} from "@angular/material/form-field";
|
import {MatError, MatFormField, MatLabel} from "@angular/material/form-field";
|
||||||
import {MatButton} from "@angular/material/button";
|
import {MatButton} from "@angular/material/button";
|
||||||
import {MatInput} from "@angular/material/input";
|
import {MatInput} from "@angular/material/input";
|
||||||
|
import {filter} from "rxjs";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-create-qualification',
|
selector: 'app-create-qualification',
|
||||||
@ -39,7 +40,7 @@ export class CreateQualificationComponent {
|
|||||||
const field = this.qualificationForm.get(fieldName);
|
const field = this.qualificationForm.get(fieldName);
|
||||||
|
|
||||||
if (!field) {
|
if (!field) {
|
||||||
return false;
|
throw new Error('Form field does not exist: ' + fieldName)
|
||||||
}
|
}
|
||||||
|
|
||||||
return field.invalid && (field.dirty || field.touched);
|
return field.invalid && (field.dirty || field.touched);
|
||||||
|
Reference in New Issue
Block a user