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

34 lines
713 B
JavaScript
Raw Normal View History

2020-10-20 07:44:44 +00:00
import ngModule from '../module';
import Descriptor from 'salix/components/descriptor';
class Controller extends Descriptor {
get supplier() {
return this.entity;
}
set supplier(value) {
this.entity = value;
}
loadData() {
const filter = {
fields: [
'id',
'name',
'nickname',
'nif'
]
};
return this.getData(`Suppliers/${this.id}`, {filter})
.then(res => this.entity = res.data);
}
}
ngModule.vnComponent('vnSupplierDescriptor', {
template: require('./index.html'),
controller: Controller,
bindings: {
supplier: '<'
}
});