Using AngularJS with a dropdown, all the options are displaying correctly when selected but their names are not showing up.
I suspect there might be an issue with the ng-options value, but I am struggling to pinpoint it.
Here is the snippet of the view:
<select ng-options="city as city.shops.code for city in cities" ng-model="selectedCity"></select>
<div class="shopsContainer">
<article class="shop" ng-repeat="shop in selectedCity.shops">
<h4>{{shop.name}}</h4>
<h4>{{shop.address1}}</h4>
</article>
</div>
Snapshot of the controller - object data feeding ng-options:
$scope.cities = [
{
code: "Barranquilla",
shops: [
{
"name":"C.C. Unico Outlet",
"address1":"Local 22",
"address2":""
}
]
},
// More city data entries...
];