Hallo Freunde hier zwei Daten in eine JSON-Datei, wo ich brauche Wählen Sie die Option erstellen, basierend auf dem Landgebiet und zeigen Daten, basierend auf dem Standort FeldErstellen Sie wählen mit otpgroup basierend auf zwei verschiedenen Daten
"countries": [
{
"id": "75",
"country": "France"
},
{
"id": "82",
"country": "Germany"
},
{
"id": "208",
"country": "Switzerland"
},
{
"id": "226",
"country": "United Kingdom"
},
{
"id": "227",
"country": "United States"
}
],
location": [
{
"id": "49",
"name": "Aberdeen",
"country_id": "226",
"country": "United Kingdom"
},
{
"id": "52",
"name": "All Cities",
"country_id": "226",
"country": "United Kingdom"
},
{
"id": "51",
"name": "All Cities",
"country_id": "82",
"country": "Germany"
},
{
"id": "50",
"name": "All Cities",
"country_id": "227",
"country": "United States"
}
{
"id": "31",
"name": "San Jose",
"country_id": "227",
"country": "United States"
},
{
"id": "42",
"name": "Seattle",
"country_id": "227",
"country": "United States"
},
{
"id": "18",
"name": "Stuttgart",
"country_id": "82",
"country": "Germany"
},
{
"id": "41",
"name": "Washington DC",
"country_id": "227",
"country": "United States"
}
],
HTML Datei
<select ng-model="location">
<optgroup ng-repeat="data in location" label="{{data.country}}">
<option ng-repeat="item in data" value="{{data.country}}::{{item.name}}">{{item.name}}</option>
</optgroup>
</select>
ich brauche, um meine Daten zu zeigen, wie folgt aussehen:
Ich versuche oben Code, aber ich bekomme keinen Erfolg. Bitte Hilfe
Dank Buddy, die Sie wirklich meinen Tag retten. – Neotrixs
Gern geschehen – jitender