我将响应数据分配给$ scope.ShippingCharges,但它不会立即对视图产生影响。
$scope.selectedAddress = function(ID)
{
$.ajax({
type: "GET",
url: "http://localhost:49917/ShoppingCart/CalculateShipping",
dataType: "json",
data: { 'Id': ID },
contentType: 'application/json; charset=utf-8',
success: function (data) {
if (data != null) {
$scope.ShippingCharges = data;
}
},
error: function (e) {
console.log(e);
}
});
}

<p style="margin:0"><span ng-bind="ShippingCharges"></span></p>
&#13;