salix/modules/item/front/summary/index.js

30 lines
587 B
JavaScript
Raw Normal View History

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
class Controller {
2018-02-20 11:33:17 +00:00
constructor($http) {
this.$http = $http;
}
getSummary() {
this.$http.get(`/item/api/Items/${this.item.id}/getSummary`).then(response => {
this.summary = response.data;
2018-02-20 11:33:17 +00:00
});
}
$onChanges() {
if (this.item && this.item.id)
this.getSummary();
2018-02-20 11:33:17 +00:00
}
}
Controller.$inject = ['$http'];
2018-02-20 11:33:17 +00:00
ngModule.component('vnItemSummary', {
template: require('./index.html'),
controller: Controller,
2018-02-20 11:33:17 +00:00
bindings: {
item: '<',
},
2018-02-20 11:33:17 +00:00
});