We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I want to ask, how to use this async button as submit button with ember-idx-forms?
Because when I click on async button, so first is called action, which is defined on on-click property and after that is called submit method at https://github.com/indexiatech/ember-forms/blob/master/addon/form.js#L52 and after that is called submit handler in the controller or route.
If you have ready some working example, pls paste it here.
Thank you for advices.
The text was updated successfully, but these errors were encountered:
So I have resolved it with Deffered.
Wait and see if you have a better solution, before closing this issue.
import Em from "ember"; var _asyncSubmitDeffer = Ember.RSVP.defer(); export default Em.Controller.extend({ actions: { submit: function() { var model = this.get('model'); if (model.get('isDirty')) { model.save().then((data) => { _asyncSubmitDeffer.resolve(); this.transitionToRoute('users') }).catch(function (reason) { _asyncSubmitDeffer.reject('Server error...'); }).finally(() => { }); } else { _asyncSubmitDeffer.resolve(); } }, asyncSumbit: function(setPromise) { return setPromise(_asyncSubmitDeffer.promise); } } });
Sorry, something went wrong.
No branches or pull requests
Hi,
I want to ask, how to use this async button as submit button with ember-idx-forms?
Because when I click on async button, so first is called action, which is defined on on-click property and after that is called submit method at https://github.com/indexiatech/ember-forms/blob/master/addon/form.js#L52 and after that is called submit handler in the controller or route.
If you have ready some working example, pls paste it here.
Thank you for advices.
The text was updated successfully, but these errors were encountered: