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

35 lines
738 B
JavaScript

import ngModule from '../../module';
import Section from 'salix/components/section';
class Controller extends Section {
constructor($element, $) {
super($element, $);
this.recovery = {
started: new Date()
};
}
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.component('vnClientRecoveryCreate', {
template: require('./index.html'),
controller: Controller
});