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

35 lines
742 B
JavaScript

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