My JSON structure looks like this:
101 :
"List": [
{
"Name": "Pink"
},
{
"Name": "Black"
}
]
102 :
"List": [
{
"Name": "Red"
},
{
"Name": "Yellow"
}
]
$scope.Ids = [101,102,103,104];
Currently, I am using an ng-repeat loop to iterate over the list of IDs (for example: 101,102) and my goal is to populate a dropdown based on a specific ID. For instance, for ID 101, I want to populate Pink and Black, and for ID 102, I want to populate Red and Yellow in the dropdown. For the rest of the IDs, I want to ignore them altogether. However, I am struggling to figure out how to achieve this.
Here's the code snippet:
<div ng-repeat="item in Ids track by item.id">
<select ng-model="color" ng-options="">
<option value="">-- choose color --</option>
</select>
</div>