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

28 lines
604 B
JavaScript
Raw Normal View History

2020-10-30 10:40:12 +00:00
import ngModule from '../module';
import './style.scss';
import Section from 'salix/components/section';
class Controller extends Section {
add() {
this.$.model.insert({
supplierFk: this.supplier.id
});
}
onSubmit() {
this.$.watcher.check();
this.$.model.save().then(() => {
this.$.watcher.notifySaved();
this.$.watcher.updateOriginalData();
});
}
}
ngModule.vnComponent('vnSupplierContact', {
template: require('./index.html'),
controller: Controller,
bindings: {
supplier: '<'
}
});