I have this array of objects here:
$scope.breadsticks = [
{
name: 'Garlic Buttered',
price: { priceSM: 3.99, priceMD: 4.99, priceLG: 5.99 },
size: { sizeSM: '6 pcs', sizeMD: '10 pcs', priceLG: '14 pcs' },
description: 'Garlic buttery goodness on a stick of cheesy bread.',
},
{
name: 'Mozzarella Stuffed',
price: { priceSM: 4.49, priceMD: 5.49, priceLG: 6.49 },
size: { sizeSM: '6 pcs', sizeMD: '10 pcs', priceLG: '14 pcs' },
description: 'Jam packed with that mozzarella gucci we know you love.',
}
];
I want to create a select list that only displays the size: { sizeSM: '6 pcs', sizeMD: '10 pcs', priceLG: '14 pcs' } information:
<td>
<select ng-model="breadstick.selectedItem" ng-options="breadstick.size for breadstick in breadsticks">
</select>
</td>
<td>
{{breadstick.selectedItem.price}}
</td>
And I would also like the corresponding price to be displayed when the select list changes.
Any help or bumps into the right direction would be greatly appreciated.