import ngModule from '../module'; class Controller { constructor($http) { this.$http = $http; } getSummary() { this.$http.get(`/item/api/Items/${this.item.id}/getSummary`).then(response => { this.summary = response.data; }); } $onChanges() { if (this.item && this.item.id) this.getSummary(); } } Controller.$inject = ['$http', '$stateParams']; ngModule.component('vnItemSummary', { template: require('./index.html'), controller: Controller, bindings: { item: '<' } });