salix/modules/account/front/role/descriptor/index.js

27 lines
601 B
JavaScript
Raw Normal View History

import ngModule from '../../module';
import Descriptor from 'salix/components/descriptor';
class Controller extends Descriptor {
get role() {
return this.entity;
}
set role(value) {
this.entity = value;
}
onDelete() {
return this.$http.delete(`Roles/${this.id}`)
.then(() => this.$state.go('account.role'))
.then(() => this.vnApp.showSuccess(this.$t('Role removed')));
}
}
ngModule.component('vnRoleDescriptor', {
template: require('./index.html'),
controller: Controller,
bindings: {
role: '<'
}
});