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

27 lines
620 B
JavaScript
Raw Normal View History

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,
2019-03-13 10:27:45 +00:00
price: 0.20,
bonus: 0.20,
2018-09-24 12:51:27 +00:00
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
});