import ngModule from '../module'; import './style.scss'; class Controller { constructor($scope, $http, $state) { this.$scope = $scope; this.$http = $http; this.$state = $state; this.setSummary(); } setSummary() { this.$http.get(`/order/api/Orders/${this.$state.params.id}/summary`).then(res => { if (res && res.data) { this.summary = res.data; console.log(res.data); } }); } get formattedAddress() { if (!this.summary) return; let address = this.summary.address; let province = address.province ? `(${address.province.name})` : ''; return `${address.street} - ${address.city} ${province}`; } /* showDescriptor(event, itemFk) { this.quicklinks = { btnThree: { icon: 'icon-transaction', state: `item.card.diary({ id: ${itemFk}, warehouseFk: ${this.ticket.warehouseFk}, ticketFk: ${this.ticket.id} })`, tooltip: 'Item diary' } }; this.$scope.descriptor.itemFk = itemFk; this.$scope.descriptor.parent = event.target; this.$scope.descriptor.show(); } onDescriptorLoad() { this.$scope.popover.relocate(); } */ } Controller.$inject = ['$scope', '$http', '$state']; ngModule.component('vnOrderSummary', { template: require('./index.html'), controller: Controller, bindings: { order: '<' } });