Answers for "set selected value of dropdown using formcontrol in angular"

0

set selected value of dropdown using formcontrol in angular

this.countryForm.controls['country'].valueChanges.subscribe(country => 
  this.person.country = country;
);

// initialize by finding the correct country object (this will overwrite the person's country object)
this.countryForm.controls['country'].setValue(countries.filter(c => c.id === person.country.id));
Posted by: Guest on March-14-2022

Code answers related to "set selected value of dropdown using formcontrol in angular"

Code answers related to "Javascript"

Browse Popular Code Answers by Language