29 lines
632 B
JavaScript
29 lines
632 B
JavaScript
import ngModule from '../module';
|
|
import Section from 'salix/components/section';
|
|
|
|
class Controller extends Section {
|
|
add() {
|
|
this.$.model.insert({
|
|
clientFk: this.client.id,
|
|
name: this.$t('Phone'),
|
|
phone: null
|
|
});
|
|
}
|
|
|
|
onSubmit() {
|
|
this.$.watcher.check();
|
|
this.$.model.save().then(() => {
|
|
this.$.watcher.notifySaved();
|
|
this.$.watcher.updateOriginalData();
|
|
});
|
|
}
|
|
}
|
|
|
|
ngModule.component('vnClientContact', {
|
|
template: require('./index.html'),
|
|
controller: Controller,
|
|
bindings: {
|
|
client: '<'
|
|
}
|
|
});
|