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

28 lines
595 B
JavaScript
Raw Normal View History

import ngModule from '../module';
2020-03-17 10:17:50 +00:00
import Section from 'salix/components/section';
2020-03-17 10:17:50 +00:00
class Controller extends Section {
2018-08-27 09:22:59 +00:00
add() {
2020-03-17 10:17:50 +00:00
this.$.model.insert({
2018-08-27 09:22:59 +00:00
clientFk: this.client.id,
name: this.$translate.instant('Phone'),
phone: null
});
}
2018-08-27 09:22:59 +00:00
onSubmit() {
2020-03-17 10:17:50 +00:00
this.$.watcher.check();
this.$.model.save().then(() =>
this.$.watcher.notifySaved()
);
}
}
2018-07-31 09:08:22 +00:00
ngModule.component('vnClientContact', {
template: require('./index.html'),
controller: Controller,
bindings: {
client: '<'
}
});