You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some hard coded messages in validator file ,i have injected the i18n from component class, but its not working , i m not able to extract the value in .xlf file.
Hi
I have some hard coded messages in validator file ,i have injected the i18n from component class, but its not working , i m not able to extract the value in .xlf file.
import { AbstractControl, ValidationErrors } from '@angular/forms';
import {I18n} from "@ngx-translate/i18n-polyfill";
export class ConfirmMatchValidator {
static match(confirm: string, actual: string, i18n:I18n) {
i18n("hi , For testing");
return (formGroup: AbstractControl): ValidationErrors | null => {
//some validator code
return null;
};
}
}
in component class
private updatingEmailForm() {
this.updateEmailForm = this.fb.group(
{
newEmail: ['', [Validators.required, Validators.maxLength(50), EmailValidator]],
confirmEmail: ['', [Validators.required, Validators.maxLength(50), EmailValidator]]
},
{ validator: ConfirmMatchValidator.match('confirmEmail', 'newEmail',this.i18n) }
);
}
The text was updated successfully, but these errors were encountered: