salix/modules/zone/front/descriptor/index.js

26 lines
531 B
JavaScript
Raw Normal View History

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 {
get zone() {
return this.entity;
2018-12-04 12:18:27 +00:00
}
set zone(value) {
this.entity = value;
}
2020-04-25 09:50:04 +00:00
onDeleteAccept() {
return this.$http.delete(`Zones/${this.id}`)
.then(() => this.$state.go('zone.index'));
}
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: '<'
}
});