I want to create a custom validation function for my form group which validates the input of the country matches to my country list item.
This is my country list:
this.sharedService.getCountry().subscribe(res => {
res.map(item => {
this.countryList.push(item);
});
});
my form is:
this.form = fb.group({
country: new FormControl('', [Validators.required]),
});