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

33 lines
748 B
JavaScript
Raw Normal View History

import ngModule from '../module';
class Controller {
constructor($scope, $stateParams) {
this.$scope = $scope;
this.$stateParams = $stateParams;
2018-03-21 10:08:59 +00:00
}
add() {
this.$scope.model.insert({
packagingFk: null,
quantity: null,
created: new Date(),
ticketFk: this.$stateParams.id
2018-03-21 10:08:59 +00:00
});
}
2018-03-21 10:08:59 +00:00
onSubmit() {
this.$scope.watcher.check();
this.$scope.model.save().then(() => {
this.$scope.watcher.notifySaved();
this.$scope.model.refresh();
2018-03-21 10:08:59 +00:00
});
}
}
Controller.$inject = ['$scope', '$stateParams'];
2018-03-27 13:06:22 +00:00
ngModule.component('vnTicketPackageIndex', {
template: require('./index.html'),
controller: Controller
});