本文整理汇总了TypeScript中ionic-angular.Toast.present方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Toast.present方法的具体用法?TypeScript Toast.present怎么用?TypeScript Toast.present使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular.Toast
的用法示例。
在下文中一共展示了Toast.present方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: toasterFail
public toasterFail(mensagem: string, showCloseButton: boolean = true, duration: number = null) {
if (mensagem) {
var toasterOptions = {
message: mensagem, duration: duration, position: 'top',
cssClass: 'toast-fail', showCloseButton: showCloseButton, closeButtonText: 'Ok'
};
this.toaster = this.toasterCtrl.create(toasterOptions);
this.toaster.present();
}
}
示例2: toasterSuccess
public toasterSuccess(mensagem: string, showCloseButton: boolean = false, duration: number = 3000) {
if (mensagem) {
var toasterOptions = {
message: mensagem, duration: duration, position: 'top',
cssClass: 'toast-success', showCloseButton: showCloseButton, closeButtonText: 'Ok'
};
this.toaster = this.toasterCtrl.create(toasterOptions);
this.toaster.present();
}
}
示例3: showToast
showToast(options: any) {
if(this.loading) {
//noinspection TypeScriptUnresolvedFunction
this.dismissLoading().then(() => this.showToast(options));
}
if(this.toast) {
//noinspection TypeScriptUnresolvedFunction
this.dismissToast().then(() => this.showToast(options));
}
this.toast = this.toastController.create(options);
this.toast.present();
}
示例4: create
create(message, ok = false, duration = 2000) {
if (this.toast) {
this.toast.dismiss();
}
this.toast = this.toastCtrl.create({
message,
duration: ok ? null : duration,
position: 'bottom',
showCloseButton: ok,
closeButtonText: 'OK'
});
this.toast.present();
}