salix/modules/ticket/front/services/index.js

32 lines
703 B
JavaScript
Raw Normal View History

2018-11-30 06:57:41 +00:00
import ngModule from '../module';
class Controller {
constructor($scope, $stateParams) {
this.$scope = $scope;
this.$stateParams = $stateParams;
}
add() {
this.$scope.model.insert({
taxClassFk: 2,
quantity: 1,
ticketFk: this.$stateParams.id
});
}
onSubmit() {
this.$scope.watcher.check();
this.$scope.model.save().then(() => {
this.$scope.watcher.notifySaved();
this.$scope.model.refresh();
});
}
}
Controller.$inject = ['$scope', '$stateParams'];
ngModule.component('vnTicketService', {
template: require('./index.html'),
controller: Controller
});