I have data in this form:
$scope.data = [
{name: 'Giani, Pitampura', _id: '01', city:'Delhi'},
{name: 'Giani, Rajouri', _id: '02', city:'Delhi'},
{name: 'Dominoz, Mayur Vihar ', _id: '03', city:'Delhi'},
{name: 'Dominoz, Andheri east', _id: '04', city:'Mumbai'},
{name: 'Dominoz, Andheri west', _id: '05', city:'Mumbai'},
{name: 'Pizaa planet, west road', _id: '06', city:'Kolkata'},
{name: 'Food panda, Gurgaon', _id: '07', city:'Haryana'}
];
Now, I need to create 2 dropdowns:
- City
- Restaurant The cities list should be populated with unique city names from this data and depending on the city value selected, second drop down should be populated with restaurant names.
How do I go about this?