Join tables in AngularJS

1

I'm really in need of some help from you. I'm currently developing a web app for a multi-module restaurant.

In the box module, a <div> is displaying the requests that are open as they show the codes below.

Now what I need is that instead of showing every orderOpen separately, the orders that are with the same Order.board are in one. Merge all orders that share 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;
        });
  });
}

box.html

<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>
    
asked by anonymous 30.10.2017 / 21:54

0 answers