-1

I am using reactive forms in Angular Martial 7 and I am trying to validate multiple emails separated by commas in input files, but it shows an error through custom directive. How can I fix this?

Pika Supports Ukraine
  • 3,612
  • 10
  • 26
  • 42

1 Answers1

0

Use angulars FormGroup and define your errors there:

export class ContactComponent implements OnInit {
messageForm: FormGroup;
constructor(private formBuilder: FormBuilder) { }
ngOnInit() {
this.messageForm = this.formBuilder.group({
//place your validations here
  name: ['', Validators.required],
  message: ['', Validators.required]
});

}

Flash
  • 924
  • 3
  • 22
  • 44