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

25 lines
550 B
JavaScript
Raw Normal View History

2018-02-20 11:33:17 +00:00
import ngModule from '../module';
2020-11-23 12:41:51 +00:00
import Summary from 'salix/components/summary';
2018-07-24 10:53:26 +00:00
import './style.scss';
2018-02-20 11:33:17 +00:00
2020-11-23 12:41:51 +00:00
class Controller extends Summary {
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
}
}
ngModule.vnComponent('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
});