Hi Cristian,
Hmm, you don’t need a $scope.$apply in there.
try this:
$scope.buy = function () {
var bought = { ProductID: $scope.prodID, UnitPrice: $scope.unitPrice,
Quantity: $scope.quantity, Discount: $scope.discount, OrderID: $scope.OrderId };
$.post('Sales/SaveOrderDetail', bought, function (data) {
alert(data.Message);
$http.get('Sales/GetOrderDetails/' + $scope.OrderId).success(function
(data) {
$scope.orderDetails = data;
});
});
};
I moved your $http.get inside your post, so the server has the time to save
the stuff before you get it again.
Regards
Sander
--
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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.