I am using AngularJS and I got a simple select element with static options. I want to get an element on a certain index of an array when i click on one option.
Forgive me if this is ridiculous but I am new with Angular JS
Here are the class and the dropdown-list
$scope.products=[
{
"Id":1,
"Name":"ice cream",
"Price":8.50
},
{
"Id":2,
"Name":"salad",
"Price":8.99
},
{
"Id":3,
"Name":"fish & chips",
"Price":10.91
}
]
<select name="singleSelect" ng-model="data.selectedOption">
<option ng-repeat="product in products" ng-model="selectedOption" value="{{product.Id}}">{{product.Name}}</option>
</select>
For example when I click on ice cream, next to the dropdown-list, there should be the price of the item.
ng-modelon<option>. Only the<select>itself gets bound to data model