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

27 lines
570 B
JavaScript
Raw Normal View History

2020-10-20 07:44:44 +00:00
import ngModule from '../module';
import Section from 'salix/components/section';
import './style.scss';
class Controller extends Section {
$onChanges() {
if (!this.supplier)
return;
this.getSummary();
}
getSummary() {
this.$http.get(`Suppliers/${this.supplier.id}/getSummary`).then(response => {
this.summary = response.data;
});
}
}
ngModule.vnComponent('vnSupplierSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
supplier: '<'
}
});