import ngModule from '../module'; import Component from 'core/src/lib/component'; import './style.scss'; class Controller extends Component { constructor($element, $scope, $http) { super($element, $scope); this.$http = $http; this._quicklinks = {}; this.isTooltip = true; this.clear(); } set itemFk(id) { this._itemFk = id; if (id) { this._getItem(); } else this.clear(); } set quicklinks(value = {}) { this._quicklinks = Object.assign(value, this._quicklinks); } get quicklinks() { return this._quicklinks; } clear() { this.item = null; this.tags = {}; this.itemTags = null; } show() { this.$.popover.parent = this.parent; this.$.popover.show(); } _getItem() { this.$http.get(`/item/api/Items/${this._itemFk}/getCard`).then(response => { this.item = response.data; }); } } Controller.$inject = ['$element', '$scope', '$http']; ngModule.component('vnItemDescriptorPopover', { template: require('./index.html'), bindings: { itemFk: '<', quicklinks: '<' }, controller: Controller });