>
>
> It sound as if you are updating your data outside angular. That is not a 
> problem, but you need to $scope.$apply your update then!
>
>
> Yeah I think I am. This is my code
 $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;
            $scope.$apply()
           
            
        })


        
    } 

but i get a $digest error in my console thus: 
Error: [$rootScope:inprog] $digest already in progress

.
This is a portion of my template that was supposed to be updated. 
<div class="row" ng-show="OrderId">
        <div class="col-md-5 col-md-offset-7" id="">




            <input id="searchCust" type="text" class="form-control" ng-model
="searchOrders" />


            <div class="table-responsive">
                <table class="table">
                    <thead>
                        <tr>
                            <th>Product</th>
                            <th>Quantity</th>
                            


                        </tr>
                    </thead>


                    <tbody>
                        <tr ng-show="ord.OrderDetailID" id=
"Ord_{{ord.OrderDetailID}}" ng-repeat="ord in orderDetails | 
filter:searchOrders">
                            <td>{{ord.ProductName}}</td>
                            <td>{{ord.Quantity}}</td>
                            
                            <td id="h"><button class="btn btn-danger btn-xs" 
ng-click="removeOrderDetail(ord.OrderDetailID)" id="{{ord.OrderDetailID}}">
Remove</button></td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>


Thanks

-- 
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.

Reply via email to