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