When I have two dropdowns, I aim to update the second dropdown with a matching JSON object based on the value selected in the first dropdown.
JSON
this.dropdownValues = {
"mysql 8": {
"flavor": [
"medium",
"small",
"large"
],
"version": "mysql 8"
},
"mysql 5.7": {
"flavor": [
"small",
"medium"
],
"version": "mysql 5.7"
}
}
This JSON displays version values in the first dropdown. Upon changing the selection in the first dropdown, I want the second dropdown to show the related flavor array. For example, if I select "mysql 5.7," then the second dropdown should display "small" and "medium" as flavor options.
In Angular 8, how can I achieve this functionality? While I am able to populate the dropdown values in my HTML page, I am uncertain about how to retrieve the flavor value when the selected version matches.