import ngModule from '../module'; class Controller { constructor($http, $state) { this.$http = $http; this.$state = $state; this.item = null; } _getCard() { this.$http.get(`/item/api/Items/${this.$state.params.id}/getCard`).then(response => { this.item = response.data; }); } $onInit() { this._getCard(); } } Controller.$inject = ['$http', '$state']; ngModule.component('vnItemCard', { template: require('./index.html'), controller: Controller });