import ngModule from '../module'; import DescriptorPopover from 'salix/components/descriptor-popover'; class Controller extends DescriptorPopover { get worker() { return this.entity; } loadData() { const filter = { include: [ { relation: 'user', scope: { fields: ['name'], include: { relation: 'emailUser', scope: { fields: ['email'] } } } }, { relation: 'client', scope: {fields: ['fi']} }, { relation: 'sip', scope: {fields: ['extension']} }, { relation: 'department', scope: { include: { relation: 'department' } } } ] }; return this.getData(`Workers/${this.id}`, {filter}) .then(res => this.entity = res.data); } } ngModule.vnComponent('vnWorkerDescriptorPopover', { slotTemplate: require('./index.html'), controller: Controller });