本文整理汇总了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();
});