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