*Created an Angular Service:*
calculator_app.service('FillOpportunity', function () {
this.fill_opportunity = function (path,scope) {
$.ajax({
url: 'opportunitycalculator/calculator/GetProducts?idstring=' +
path,
type: "GET",
cache: false,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data)
{
scope.opportunity_data = data;
scope.average_price = 2300;
scope.$apply();
},
error: function () {
alert('error');
scope.opportunity_data = "error";
}
});
};
});
*called the service on ng-change of a dropdown :*
FillOpportunity.fill_opportunity($scope.result_path,$scope);
*The scope.opportunity_data is binded to the select in UI:*
<select id="seloppurtunityproducts" name="selproducttype" multiple=""
style="height:300px" ng-model="opportunity_products" ng-options="a for a in
opportunity_data"></select>
On ng-Change, Ajax is called when I check in Network of chrome, but the
value is not updated in the select box.
Any inputs?
Krishna Prasad
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.