To unite tables in Angularjs

Asked

Viewed 24 times

1

I am in great need of a help from your knowledge. I am currently developing a web app for a restaurant with several modules.

In the box module, in a <div> are displaying the requests that are open as sample the codes below.

Now what I need is that instead of showing each orderOpen separately, orders that are with the same Order.board be in one. Join all orders sharing the same table number.

Order js.

 $scope.orderFindOpen = function(  ) {
    Order.orderFindOpen(function(result){
        console.log("pedido em aberto");
        console.log(result.orders);
        $scope.ordersOpen = result.orders;
        $scope.ordersOpen.forEach(function(order, $index){
            $scope.ordersOpen[$index].board = Order.board({id: order.id});
            $scope.ordersOpen[$index].payment = PAY[order.payment].dsca;
        });
  });
}

html box.

<div class="container12">
    <div class="cls89 a_icon" ng-repeat="order in ordersOpen" ng-click="selectedOrder(order)" >
        <span class="cls06 cls08"></span>
        <img src="../../images/ico-mesa.png" alt="Norway" class="cls90" >
        <label class="cls85 cls86">{{ order.board.number }}</label>
    </div>
</div>
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.