When creating a form in TypeScript, I encountered an issue:
private _createForm() {
this.addForm = this._formBuilder.group({
login: [ null, Validators.required ],
name: [ null, Validators.required ],
surname: [ null, Validators.required ],
email: [ null, Validators.required, Validators.email]
});
}
After implementing the form in HTML, the validation for the email field was not functioning as expected:
...
<forms-validation feedback="Niepoprawny adres email" [dataObj]="addForm ? addForm.controls.email : null" [inputRef]="email">
<input type="text" name="email" formControlName="email" #email maxlength="{{maxlength}}" class="form-control" LayoutInput />
</forms-validation>
...
Although required validation is working correctly, the email validator is not functioning as intended.