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

25 lines
550 B
JavaScript

import ngModule from '../module';
import Section from 'salix/components/section';
import './style.scss';
class Controller extends Section {
getSummary() {
this.$http.get(`Items/${this.item.id}/getSummary`).then(response => {
this.summary = response.data;
});
}
$onChanges() {
if (this.item && this.item.id)
this.getSummary();
}
}
ngModule.vnComponent('vnItemSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
item: '<',
},
});