salix/modules/claim/front/development/index.js

32 lines
777 B
JavaScript
Raw Normal View History

2018-09-05 09:48:38 +00:00
import ngModule from '../module';
import './style.scss';
class Controller {
constructor($state, $scope, aclService) {
2018-09-05 09:48:38 +00:00
this.$state = $state;
this.$scope = $scope;
this.aclService = aclService;
2018-09-05 09:48:38 +00:00
}
onSubmit() {
this.$scope.watcher.check();
this.$scope.model.save().then(() => {
this.$scope.watcher.notifySaved();
this.$scope.watcher.updateOriginalData();
if (this.aclService.hasAny(['salesAssistant']))
this.$state.go('claim.card.action');
2018-09-05 09:48:38 +00:00
});
}
}
Controller.$inject = ['$state', '$scope', 'aclService'];
2018-09-05 09:48:38 +00:00
ngModule.component('vnClaimDevelopment', {
template: require('./index.html'),
controller: Controller,
bindings: {
claim: '<'
}
});