From ded3fda09b17a6158222aea764f495ad91947576 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Mon, 12 Nov 2018 11:22:25 +0100 Subject: [PATCH] #779 ticket.ticketRequester --- client/ticket/src/request/index.html | 68 ++++++++++++++++++++++++++++ client/ticket/src/request/index.js | 29 ++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 client/ticket/src/request/index.html create mode 100644 client/ticket/src/request/index.js diff --git a/client/ticket/src/request/index.html b/client/ticket/src/request/index.html new file mode 100644 index 000000000..c3663d7e1 --- /dev/null +++ b/client/ticket/src/request/index.html @@ -0,0 +1,68 @@ + + + + +
+ + Purchase request + + + + + + + {{firstName}} {{name}} + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/client/ticket/src/request/index.js b/client/ticket/src/request/index.js new file mode 100644 index 000000000..84b1fe0ec --- /dev/null +++ b/client/ticket/src/request/index.js @@ -0,0 +1,29 @@ +import ngModule from '../module'; + +class Controller { + constructor($stateParams, $scope) { + this.$stateParams = $stateParams; + this.$scope = $scope; + } + + add() { + this.$scope.model.insert({ + ticketFk: this.$stateParams.id + }); + } + + onSubmit() { + this.$scope.watcher.check(); + this.$scope.model.save().then(() => { + this.$scope.watcher.notifySaved(); + this.$scope.model.refresh(); + }); + } +} + +Controller.$inject = ['$stateParams', '$scope']; + +ngModule.component('vnTicketRequest', { + template: require('./index.html'), + controller: Controller +});