From 1f89ff69efb9fa7f300d81d52823341501cea06d Mon Sep 17 00:00:00 2001 From: ThomasBidot <77505438+ThomasBidot@users.noreply.github.com> Date: Tue, 7 Dec 2021 16:27:16 +0100 Subject: [PATCH] Back to no mail verification --- src/app/signup/core/password.matcher.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/app/signup/core/password.matcher.ts diff --git a/src/app/signup/core/password.matcher.ts b/src/app/signup/core/password.matcher.ts new file mode 100644 index 0000000..8d9f40e --- /dev/null +++ b/src/app/signup/core/password.matcher.ts @@ -0,0 +1,10 @@ +import { FormControl, FormGroupDirective, NgForm } from '@angular/forms'; +import { ErrorStateMatcher } from '@angular/material'; + +// From: https://stackoverflow.com/a/51606362 +export class PasswordErrorStateMatcher implements ErrorStateMatcher { + isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean { + const invalidParent = !!(control && control.parent && control.parent.invalid && control.parent.dirty); + return (control && control.dirty && invalidParent); + } +} -- GitLab