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

28 lines
604 B
JavaScript

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: '<'
}
});