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

29 lines
565 B
JavaScript
Raw Normal View History

2018-12-04 12:18:27 +00:00
import ngModule from '../module';
2018-09-24 08:43:54 +00:00
class Controller {
constructor($scope, $state) {
2018-09-24 08:43:54 +00:00
this.$scope = $scope;
this.$state = $state;
2018-09-24 08:43:54 +00:00
}
onSubmit() {
this.$scope.watcher.submit().then(() => {
this.$state.go('zone.card.location');
2018-09-24 08:43:54 +00:00
this.card.reload();
});
}
}
Controller.$inject = ['$scope', '$state'];
2018-09-24 08:43:54 +00:00
ngModule.component('vnZoneEdit', {
2018-09-24 08:43:54 +00:00
template: require('./index.html'),
controller: Controller,
bindings: {
zone: '<'
},
require: {
card: '^vnZoneCard'
}
});