Skip to content

Instantly share code, notes, and snippets.

@dpalou
Last active May 4, 2022 07:46
Show Gist options
  • Save dpalou/3b83f817e825c5ac7512d2086a63353e to your computer and use it in GitHub Desktop.
Save dpalou/3b83f817e825c5ac7512d2086a63353e to your computer and use it in GitHub Desktop.
this.saveData = (params) => {
this.CoreDomUtilsProvider.showModalLoading().then((modal) => {
params.vote = prep_data();
this.CoreSitePluginsProviders.callWS('mod_vote_vote', params, {getFromCache: 0, saveToCache: 0}).then((result) => {
check_response(result);
}).catch((error) => {
this.CoreDomUtilsProvider.showErrorModalDefault(error, 'core.serverconnection', true);
}).finally(() => {
modal.dismiss();
});
});
};
<ion-button expand="full" (click)="saveData({id: <% id %>, type: <% type %})">
{{ 'plugin.mod_vote.submit' | translate }}
</ion-button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment