salix/modules/client/front/greuge/create/index.js

35 lines
723 B
JavaScript

import ngModule from '../../module';
import Section from 'salix/components/section';
class Controller extends Section {
constructor($element, $) {
super($element, $);
this.greuge = {
shipped: new Date(),
clientFk: this.$params.id
};
}
cancel() {
this.goToIndex();
}
goToIndex() {
this.$state.go('client.card.greuge.index');
}
onSubmit() {
this.$.watcher.submit().then(
() => {
this.goToIndex();
}
);
}
}
Controller.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnClientGreugeCreate', {
template: require('./index.html'),
controller: Controller
});