salix/modules/zone/front/create/index.js

27 lines
627 B
JavaScript

import ngModule from '../module';
export default class Controller {
constructor($scope, $state) {
this.$scope = $scope;
this.$state = $state;
this.zone = {
travelingDays: 0,
price: 0.20,
bonus: 0.20,
hour: new Date()
};
}
onSubmit() {
return this.$scope.watcher.submit().then(res => {
this.$state.go('zone.card.location', {id: res.data.id});
});
}
}
Controller.$inject = ['$scope', '$state'];
ngModule.component('vnZoneCreate', {
template: require('./index.html'),
controller: Controller
});