Bug #252 CR Juan

This commit is contained in:
Javi Gallego 2018-05-02 11:54:13 +02:00
parent 80a3f0a914
commit b3405a3164
2 changed files with 13 additions and 2 deletions

View File

@ -110,6 +110,7 @@ export default class Controller {
} else if (canSubmitWatcher && !canSubmitObservations) {
this.$scope.watcher.submit().then(() => {
this.$state.go('clientCard.addresses.list', {id: this.$state.params.id});
this.card.reload();
});
} else if (!canSubmitWatcher && canSubmitObservations) {
this._submitObservations(observationsObj).then(() => {
@ -148,5 +149,8 @@ Controller.$inject = ['$state', '$scope', '$http', '$q', '$translate', 'vnApp'];
ngModule.component('vnAddressEdit', {
template: require('./address-edit.html'),
controller: Controller
controller: Controller,
require: {
card: '^vnClientCard'
}
});

View File

@ -1,12 +1,19 @@
import ngModule from '../module';
export default class Controller {
constructor() {
constructor($scope) {
this.$scope = $scope;
this.client = null;
}
reload() {
this.$scope.edit.accept();
}
}
Controller.$inject = ['$scope'];
ngModule.component('vnClientCard', {
template: require('./card.html'),
controller: Controller
});