salix/modules/ticket/front/tracking/edit/index.js

31 lines
751 B
JavaScript

import ngModule from '../../module';
class Controller {
constructor($scope, $state, vnApp, $translate) {
this.$ = $scope;
this.$state = $state;
this.vnApp = vnApp;
this.$translate = $translate;
this.ticket = {
ticketFk: $state.params.id
};
}
onSubmit() {
this.$.watcher.submit().then(
() => {
this.card.reload();
this.$state.go('ticket.card.tracking.index');
}
);
}
}
Controller.$inject = ['$scope', '$state', 'vnApp', '$translate'];
ngModule.component('vnTicketTrackingEdit', {
template: require('./index.html'),
controller: Controller,
require: {
card: '^vnTicketCard'
}
});