salix/client/ticket/src/data/step-two/step-two.js

29 lines
647 B
JavaScript
Raw Normal View History

import ngModule from '../../module';
class Controller {
constructor($http, $scope) {
this.$http = $http;
this.$scope = $scope;
}
$onChanges(data) {
if (!this.ticket || !this.ticket.id) return;
let query = `/ticket/api/sales/${this.ticket.id}/priceDifference`;
this.$http.get(query).then(res => {
if (res.data)
this.ticket.sales = res.data;
});
}
}
Controller.$inject = ['$http', '$scope'];
ngModule.component('vnTicketDataStepTwo', {
template: require('./step-two.html'),
controller: Controller,
bindings: {
ticket: '<'
}
});