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

25 lines
548 B
JavaScript
Raw Normal View History

2018-02-20 11:33:17 +00:00
import ngModule from '../module';
2020-03-17 13:43:46 +00:00
import Section from 'salix/components/section';
2018-07-24 10:53:26 +00:00
import './style.scss';
2018-02-20 11:33:17 +00:00
2020-03-17 13:43:46 +00:00
class Controller extends Section {
getSummary() {
this.$http.get(`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
}
}
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
});