import ngModule from '../module'; import './style.scss'; class Controller { constructor($http) { this.$http = $http; } $onChanges() { if (!this.ticket) return; this.$http.get(`/client/api/Tickets/${this.ticket.id}/summary`).then(res => { if (res && res.data) this.summary = res.data; }); } } Controller.$inject = ['$http']; ngModule.component('vnTicketSummary', { template: require('./ticket-summary.html'), controller: Controller, bindings: { ticket: '<' } });