Skip to content

Instantly share code, notes, and snippets.

@jcamilom
Created September 18, 2020 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcamilom/0cba2ded0c2d397ec4b5fe107980c900 to your computer and use it in GitHub Desktop.
Save jcamilom/0cba2ded0c2d397ec4b5fe107980c900 to your computer and use it in GitHub Desktop.
writeValue(values: any[]): void {
this.selectedValues = [];
values = values || [];
values.forEach(selectedValue => {
const selectedOption = this.options.find(v => v.value === selectedValue);
selectedOption.control.setValue(true);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment