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?
Asked
Active
Viewed 25 times
-1
-
3kindly share the stackblitz with a minimal working example – Akber Iqbal Mar 07 '19 at 11:19
1 Answers
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