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

27 lines
621 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,
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 => {
2018-09-19 13:05:07 +00:00
this.$state.go('zone.card.basicData', {id: res.data.id});
});
}
}
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
});