salix/client/ticket/src/summary/ticket-summary.js

28 lines
556 B
JavaScript
Raw Normal View History

2018-03-14 11:12:06 +00:00
import ngModule from '../module';
2018-04-10 05:48:04 +00:00
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'];
2018-03-14 11:12:06 +00:00
ngModule.component('vnTicketSummary', {
template: require('./ticket-summary.html'),
2018-04-10 05:48:04 +00:00
controller: Controller,
2018-03-14 11:12:06 +00:00
bindings: {
ticket: '<'
}
});