2018-12-04 12:18:27 +00:00
|
|
|
import ngModule from '../module';
|
2020-04-25 09:50:04 +00:00
|
|
|
import Descriptor from 'salix/components/descriptor';
|
2018-12-04 12:18:27 +00:00
|
|
|
|
2020-04-25 09:50:04 +00:00
|
|
|
class Controller extends Descriptor {
|
2020-04-30 10:48:52 +00:00
|
|
|
get zone() {
|
|
|
|
return this.entity;
|
2018-12-04 12:18:27 +00:00
|
|
|
}
|
2018-12-04 13:38:56 +00:00
|
|
|
|
2020-04-30 10:48:52 +00:00
|
|
|
set zone(value) {
|
|
|
|
this.entity = value;
|
2018-12-04 13:38:56 +00:00
|
|
|
}
|
|
|
|
|
2020-04-25 09:50:04 +00:00
|
|
|
onDeleteAccept() {
|
2020-04-30 10:48:52 +00:00
|
|
|
return this.$http.delete(`Zones/${this.id}`)
|
|
|
|
.then(() => this.$state.go('zone.index'));
|
2018-12-04 13:38:56 +00:00
|
|
|
}
|
2018-12-04 12:18:27 +00:00
|
|
|
}
|
|
|
|
|
2020-04-25 09:50:04 +00:00
|
|
|
ngModule.vnComponent('vnZoneDescriptor', {
|
2018-12-04 12:18:27 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
zone: '<'
|
|
|
|
}
|
|
|
|
});
|