Merge branch 'dmp-refactoring' of code-repo.d4science.org:MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
ecd69281e6
|
@ -1,4 +1,4 @@
|
|||
import { AfterContentChecked, Directive } from "@angular/core";
|
||||
import { AfterContentChecked, Directive, Optional } from "@angular/core";
|
||||
import { AbstractControl } from "@angular/forms";
|
||||
import { MatFormField } from "@angular/material/form-field";
|
||||
import { MatInput } from "@angular/material/input";
|
||||
|
@ -15,9 +15,10 @@ import { MarkedValidatorFn } from "./validation/custom-validator";
|
|||
})
|
||||
export class ReactiveAsteriskDirective implements AfterContentChecked {
|
||||
private readonly requiredValidatornames = ['RequiredWithVisibilityRulesValidator', 'required'];
|
||||
constructor(private matFormField: MatFormField) { }
|
||||
constructor(@Optional() private matFormField: MatFormField) { }
|
||||
|
||||
ngAfterContentChecked() {
|
||||
if (!this.matFormField) return;
|
||||
const ctrl = this.matFormField._control;
|
||||
const abstractControl = ctrl?.ngControl?.control;
|
||||
const validators = (abstractControl as AbstractControl & { _rawValidators: MarkedValidatorFn[] })?._rawValidators;
|
||||
|
|
Loading…
Reference in New Issue