2018-02-20 11:33:17 +00:00
|
|
|
import ngModule from '../module';
|
2018-07-24 10:53:26 +00:00
|
|
|
import './style.scss';
|
2018-02-20 11:33:17 +00:00
|
|
|
|
2018-05-25 08:03:45 +00:00
|
|
|
class Controller {
|
2018-02-20 11:33:17 +00:00
|
|
|
constructor($http) {
|
|
|
|
this.$http = $http;
|
|
|
|
}
|
|
|
|
|
2018-07-23 07:58:07 +00:00
|
|
|
getSummary() {
|
2019-01-31 13:14:39 +00:00
|
|
|
this.$http.get(`/item/api/Items/${this.item.id}/getSummary`).then(response => {
|
2018-07-23 07:58:07 +00:00
|
|
|
this.summary = response.data;
|
2018-02-20 11:33:17 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
$onChanges() {
|
2019-01-31 13:14:39 +00:00
|
|
|
if (this.item && this.item.id)
|
2018-07-23 07:58:07 +00:00
|
|
|
this.getSummary();
|
2018-02-20 11:33:17 +00:00
|
|
|
}
|
|
|
|
}
|
2018-05-25 08:03:45 +00:00
|
|
|
|
2018-08-21 11:14:18 +00:00
|
|
|
Controller.$inject = ['$http'];
|
2018-02-20 11:33:17 +00:00
|
|
|
|
|
|
|
ngModule.component('vnItemSummary', {
|
2018-05-25 08:03:45 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
2018-02-20 11:33:17 +00:00
|
|
|
bindings: {
|
2018-10-25 11:45:29 +00:00
|
|
|
item: '<',
|
|
|
|
},
|
2018-02-20 11:33:17 +00:00
|
|
|
});
|