2018-12-04 12:18:27 +00:00
|
|
|
import ngModule from '../module';
|
2018-09-19 13:05:07 +00:00
|
|
|
|
|
|
|
export default class Controller {
|
2018-09-24 12:51:27 +00:00
|
|
|
constructor($scope, $state) {
|
2018-09-19 13:05:07 +00:00
|
|
|
this.$scope = $scope;
|
|
|
|
this.$state = $state;
|
|
|
|
this.zone = {
|
|
|
|
travelingDays: 0,
|
|
|
|
price: 0.50,
|
2018-09-24 12:51:27 +00:00
|
|
|
bonus: 0.50,
|
|
|
|
hour: new Date()
|
2018-09-19 13:05:07 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
onSubmit() {
|
2018-09-24 12:51:27 +00:00
|
|
|
this.$scope.watcher.submit().then(res => {
|
2019-01-21 10:45:53 +00:00
|
|
|
this.$state.go('zone.card.location', {id: res.data.id});
|
2018-09-19 13:05:07 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2018-09-24 12:51:27 +00:00
|
|
|
Controller.$inject = ['$scope', '$state'];
|
2018-09-19 13:05:07 +00:00
|
|
|
|
|
|
|
ngModule.component('vnZoneCreate', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|