本文整理匯總了TypeScript中@ionic/angular.ToastController.create方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToastController.create方法的具體用法?TypeScript ToastController.create怎麽用?TypeScript ToastController.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@ionic/angular.ToastController
的用法示例。
在下文中一共展示了ToastController.create方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: presentToast
async presentToast(message: string) {
const toast = await this.toastController.create({
message: message,
duration: 1000
});
toast.present();
}
示例2: mensaje_no_encontrado
async mensaje_no_encontrado() {
const mensaje = await this.toastCtrl.create({
message: 'Jugador no encontrado',
duration: 2000,
})
mensaje.present();
}
示例3: clickMe
async clickMe() {
const toast = await this.toastController.create({
closeButtonText: 'close dat toast',
duration: 1000,
message: 'Howdy ho toasty neighbor',
position: 'bottom'
});
toast.present();
}
示例4: mostrar_calificacion_mala
async mostrar_calificacion_mala() {
const mensaje = await this.ToastCtrl.create(
{
message: "SEGUIREMOS TRANAJANDO PARA MEJORAR :c",
duration: 2000,
}
);
mensaje.present();
}
示例5: mostrar_calificacion_buena
async mostrar_calificacion_buena() {
const mensaje = await this.ToastCtrl.create(
{
message: "GRACIAS POR SU APOYO!!!",
duration: 2000,
}
);
mensaje.present();
}
示例6:
this.networkService.isOnline.subscribe(async isOnline => {
if (!isOnline) {
this.statusToast = await this.toastController.create({
message: `Internet connection lost. Please check your network settings.`,
position: 'bottom'
});
this.statusToast.present();
return;
}
if (this.statusToast) {
this.statusToast.dismiss();
}
});
示例7:
err => {
if (err instanceof HttpErrorResponse) {
if (err.status === 401) {
this.router.navigateByUrl("/logout");
this.toastController
.create({
message: this.translateService.instant("SESSION_EXPIRED"),
duration: 4000
})
.then(t => {
t.present();
});
}
}
}