本文整理匯總了TypeScript中ionic-angular.ToastController.create方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToastController.create方法的具體用法?TypeScript ToastController.create怎麽用?TypeScript ToastController.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ionic-angular.ToastController
的用法示例。
在下文中一共展示了ToastController.create方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: logEvent
logEvent(event) {
if ( this.description && this.value ) {
let saved = this.events.publish('saveItem', this.description, this.value );
if (saved) {
var toast = this.toastCtrl.create({
message: 'Datos guardados',
duration: 3000
});
this.description = "";
this.value = "";
} else {
var toast = this.toastCtrl.create({
message: 'Ocurrio un problema al guardar',
duration: 3000
});
}
toast.present();
} else {
let alert = this.alertCtrl.create({
subTitle: 'La descripciĂłn y el valor son obligatorios',
buttons: ['OK']
});
alert.present();
}
}
示例2: register
register(event){
if(!event.error){
this.toast.create({
message: 'account create : '+ event.result.email,
duration: 3000
}).present();
}else{
this.toast.create({
message: event.error.message,
duration: 3000
}).present();
}
}
示例3:
this.afAuth.authState.subscribe(data => {
if (data && data.email && data.uid) {
this.toast.create({
message: `Welcome to Mitogen, ${data.email}`,
duration: 3000
}).present();
}
else {
this.toast.create({
message: `Could not find authentication details.`,
duration: 3000
}).present();
}
})
示例4:
.catch(() => {
this.toastCtrl.create({
message: 'Decryption unsuccessful',
duration: 3000,
position: 'top'
}).present();
});
示例5: show
//Mensagem que aparece no bottom(rodapĂŠ)
show(msg, duracao){
const toast = this.toastCtrl.create({
message: msg,
duration: duracao
});
return toast;
}
示例6: ionViewDidEnter
ionViewDidEnter() {
let toast = this.toastCtrl.create({
message: 'This does not actually send a support request',
duration: 3000
});
toast.present();
}
示例7:
.then(post=>{
let toast = this.toastCtrl.create({
message: 'Your post has been crreated',
duration: 3000
});
toast.present();
})
示例8: onPaymentSuccess
async onPaymentSuccess() {
let loading = this.loadingCtrl.create({
content: 'Please wait...'
});
loading.present();
await this.getTabNavByIndex(0).popToRoot({ animate: false })
await this.selectTab(1);
await this.getTabNavByIndex(1).push(TicketPage, {}, { animate: false });
let ticket = this.createFakeTicket();
this.store.dispatch(new actionsTicket.LoadSuccessAction([ticket]));
this.store.dispatch(new actionsTicket.SelectAction(ticket.id));
this.store.dispatch(new actionsUi.RootChangeTabAction(1));
await loading.dismiss();
this.toastCtrl.create({
message: "Congrats! You have purchased tickets.",
duration: 3000,
position: "bottom",
dismissOnPageChange: true,
showCloseButton: true,
closeButtonText: "OK",
}).present();
this.viewCtrl.dismiss();
}
示例9:
this.fcm.listenToNotifications().subscribe((msg) => {
const toast = this.toastCtrl.create({
message: msg.body,
duration: 3000
});
toast.present();
});
示例10:
loading.onDidDismiss(() => {
let toast = this.toastCtrl.create({
message: 'No faces detected, please try again',
duration: 2000
});
toast.present();
});