import ngModule from '../module'; class ItemCard { constructor($http, $state) { this.$http = $http; this.$state = $state; this.item = {}; } $onInit() { let filter = { include: [ {relation: "itemType"}, {relation: "origin"}, {relation: "ink"}, {relation: "producer"}, {relation: "intrastat"} ] }; this.$http.get(`/item/api/Items/${this.$state.params.id}?filter=${JSON.stringify(filter)}`).then( res => { this.item = res.data; } ); } } ItemCard.$inject = ['$http', '$state']; ngModule.component('vnItemCard', { template: require('./item-card.html'), controller: ItemCard });