import ngModule from '../module'; import Section from 'salix/components/section'; import './style.scss'; class Controller extends Section { set invoiceOut(value) { this._invoiceOut = value; if (value && value.id) this.getSummary(); } get invoiceOut() { return this._invoiceOut; } getSummary() { return this.$http.get(`InvoiceOuts/${this.invoiceOut.id}/summary`) .then(res => this.summary = res.data); } } ngModule.component('vnInvoiceOutSummary', { template: require('./index.html'), controller: Controller, bindings: { invoiceOut: '<' } });