EvanAlertService¶
Source | alert |
---|
Ionic AlertController wrapper for easier usage.
showAlert¶
alertService.showAlert(title, message, buttons, inputs);
Ionic AlertController.create wrapper to handle translations of the form.
Parameters¶
title
-string|any
: Title ‘title’ || { key: ‘title’, translateOptions: { } }message
-string|any
: Message ‘message’ || { key: ‘message’, translateOptions: { } }buttons
-Array<any
: Buttons that should be displayinputs
-Array<any>
: Inputs that should be displayed
Returns¶
Alert
: this.alertCtrl.create result
Example¶
For a bigger example view showSubmitAlert
await this
.alertService.showAlert(
'_dappdapps.alert.validTitle',
{
key: '_dappdapps.alert.dappMessage',
translateOptions: dapp
}
);
showSubmitAlert¶
alertService.showSubmitAlert(arguments);
Function description
Parameters¶
title
-string|any
: ‘title’ || { title: ‘’, translateOptions: { } }message
-string|any
: ‘message’ || { title: ‘’, translateOptions: { } }cancelText
-string
: ‘cancelText’ || { title: ‘’, translateOptions: { } }submitText
-string
: ‘submitText’ || { title: ‘’, translateOptions: { } }inputs
-Array<any>
: Inputs that should be displayed
Returns¶
Promise
returns any
: promise that is deployed on button reject / resolve
Example¶
await this
.alertService.showSubmitAlert(
'_dappdapps.alert.validTitle',
{
key: '_dappdapps.alert.dappMessage',
translateOptions: dapp
},
'cancel',
'submit'
);
addDAppAlertStyle¶
alertService.addDAppAlertStyle(arguments);
Adds an temporary style to show a better looking alert using the definition colors and img.
Parameters¶
DApp bookmark definition
-any
: DApp bookmark definition
Example¶
Reference Implementation: Favorites DApp
this.alertService.addDAppAlertStyle(this.dapps[dappKey]);