Bug #437 Boton cancelar
This commit is contained in:
parent
d6f3f22970
commit
a2de55fae5
|
@ -40,5 +40,6 @@
|
|||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit label="Save"></vn-submit>
|
||||
<vn-button ng-click="$ctrl.cancel($event)" label="Cancel"></vn-button>
|
||||
</vn-button-bar>
|
||||
</form>
|
|
@ -8,11 +8,22 @@ class Controller {
|
|||
shipped: new Date()
|
||||
};
|
||||
}
|
||||
|
||||
cancel(event) {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
this.goToIndex();
|
||||
}
|
||||
|
||||
goToIndex() {
|
||||
this.$state.go('client.card.greuge.index');
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
this.greuge.clientFk = this.$state.params.id;
|
||||
this.$.watcher.submit().then(
|
||||
() => {
|
||||
this.$state.go('client.card.greuge.index');
|
||||
this.goToIndex();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -21,5 +21,6 @@
|
|||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit label="Save"></vn-submit>
|
||||
<vn-button ng-click="$ctrl.cancel($event)" label="Cancel"></vn-button>
|
||||
</vn-button-bar>
|
||||
</form>
|
|
@ -2,11 +2,18 @@ import ngModule from '../../module';
|
|||
|
||||
export default class Controller {
|
||||
constructor($state) {
|
||||
this.$state = $state;
|
||||
this.note = {
|
||||
clientFk: parseInt($state.params.id),
|
||||
text: null
|
||||
};
|
||||
}
|
||||
|
||||
cancel(event) {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
this.$state.go('client.card.note.index', {id: this.$state.params.id});
|
||||
}
|
||||
}
|
||||
Controller.$inject = ['$state'];
|
||||
|
||||
|
|
Loading…
Reference in New Issue