From 9aceb3ea6f30764c3d2df24154e80fada9fc2a56 Mon Sep 17 00:00:00 2001 From: gerard Date: Mon, 16 Jul 2018 13:28:50 +0200 Subject: [PATCH] refactor --- .../ticket/src/create-dialog/create-dialog.js | 31 +++++++++++++++++++ client/ticket/src/sale/index.html | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 client/ticket/src/create-dialog/create-dialog.js diff --git a/client/ticket/src/create-dialog/create-dialog.js b/client/ticket/src/create-dialog/create-dialog.js new file mode 100644 index 000000000..f230912b6 --- /dev/null +++ b/client/ticket/src/create-dialog/create-dialog.js @@ -0,0 +1,31 @@ +import ngModule from '../module'; + +class Controller { + constructor($scope, $element) { + this.$ = $scope; + this.ticket = {}; + } + show() { + this.$.dialog.show(); + } + + hide() { + this.$.dialog.hide(); + } + + onResponse(response) { + this.$.ticketCreate.createTicket().then(res => { + this.callback({res}); + }); + } +} +Controller.$inject = ['$scope']; + +ngModule.component('vnTicketCreateDialog', { + template: require('./create-dialog.html'), + controller: Controller, + bindings: { + ticket: '