[
...
{
"surname":"Williams"
"name":['Holly','James','Robert','Kim']
},
{
"surname":"Jones"
"name":['Holly','Joe','Jon','Harry']
}
...
]
If I have 2 dropdowns. The second one is dependent on the first one.
The first dropdown is filled with surnames.
<select ng-model="surnameSelect" ng-options="person.surname as person.surname for person in persons">
<option value="" ng-if="!surnameSelect"></option>
</select>
Now based on the "surname" selected, I want to fill the second dropdown with the values from the array from the object where surname matches the surname selected.
My question is this. How can I find that array and how can I iterate through it using ng-options in angularJS???
Best Regards