export class OrdersController {
    constructor($mdDialog, ToastsService, OrdersService) {
        this.$mdDialog = $mdDialog;
        this.ToastsService = ToastsService;
        this.OrdersService = OrdersService;
    }

    $onInit() {
        this.orders = this.OrdersService.getOrders();

        this.OrdersService.refresh();
    }

    closeOrder(event, id) {
        const confirm = this.$mdDialog.confirm()
            .textContent("Are you sure to close the order?")
            .ariaLabel("Order closing confirmation")
            .ok("Ok")
            .cancel("Cancel")
            .targetEvent(event);

        this.$mdDialog.show(confirm).then(() => {
            this.OrdersService.closeOrder(id).then(order => {
                const message = "Closed " +
                    `#${order.orderCancelTransaction.orderID}`;

                this.ToastsService.addToast(message);
            });
        });
    }
}
OrdersController.$inject = ["$mdDialog", "ToastsService", "OrdersService"];

@@ -756,41 +756,16 @@
 e = 
-%22
+%60
 Closed 
-%22 +%0A                    %60
 #$%7Bo
@@ -804,16 +804,169 @@
 rID%7D%60;%0A%0A
+                this.ToastsService.addToast(message);%0A            %7D).catch(err =%3E %7B%0A                const message = %60ERROR $%7Berr.code%7D $%7Berr.message%7D%60;%0A%0A
         
@@ -1023,24 +1023,25 @@
         %7D);%0A
+%0A
         %7D);%0A

add error handling when closing