Hi I have following data
var myApp = angular.module('myApp', [])
.controller('TestController', ['$scope', function ($scope) {
$scope.data = [{"city":"New York","location":"123", "sales" :"233.00"},
{"city":"Chicago","location":"953", "sales":"455"}'
{"city":"New York","location":"788", "sales" :"23432.23"},
{"city":"Chicago","location":"853"}];
$scope.update=function(location){
};
}]);
In my html I have
<td>
<select ng-model="item.location" ng-options="c.location as c.city for c in data"
ng-change="update(c.location)"></select>
</td>
<td>
<div>
<span ng-model="item.sales">{{sales }} </span>
</div>
</td>
I am trying to call update function from selected value of drop down and based on the item selected I want to update the value of sale using span. I am not sure how to accomplish that part. Please let me know how to go about it. Thanks