當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ToastController.create方法代碼示例

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

  }
開發者ID:LuisEstebanArango,項目名稱:cuentas-app,代碼行數:26,代碼來源:home.ts

示例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();
   }
 }
開發者ID:windKusanagi,項目名稱:BEEP,代碼行數:13,代碼來源:register.ts

示例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();
   }
 })
開發者ID:StefBuys,項目名稱:mitogen1,代碼行數:14,代碼來源:home.ts

示例4:

 .catch(() => {
   this.toastCtrl.create({
     message: 'Decryption unsuccessful',
     duration: 3000,
     position: 'top'
   }).present();
 });
開發者ID:Darkmarus,項目名稱:blog,代碼行數:7,代碼來源:password.ts

示例5: show

 //Mensagem que aparece no bottom(rodapĂŠ)
 show(msg, duracao){
   const toast = this.toastCtrl.create({
     message: msg,
     duration: duracao
   });
   return toast;
 }
開發者ID:victtors,項目名稱:ionic-firebase-easyodonto,代碼行數:8,代碼來源:toastr-service.ts

示例6: ionViewDidEnter

 ionViewDidEnter() {
   let toast = this.toastCtrl.create({
     message: 'This does not actually send a support request',
     duration: 3000
   });
   toast.present();
 }
開發者ID:jgw96,項目名稱:ionic-conference-app,代碼行數:7,代碼來源:support.ts

示例7:

 .then(post=>{
   let toast = this.toastCtrl.create({
   message: 'Your post has been crreated',
   duration: 3000
 });
 toast.present();
 })
開發者ID:amangupta1990,項目名稱:devChat,代碼行數:7,代碼來源:newForm.ts

示例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();
    }
開發者ID:qwb0920,項目名稱:movieapp-ionic,代碼行數:29,代碼來源:payment.ts

示例9:

 this.fcm.listenToNotifications().subscribe((msg) => {
   const toast = this.toastCtrl.create({
     message: msg.body,
     duration: 3000
   });
   toast.present();
 });
開發者ID:inamit,項目名稱:bigidea,代碼行數:7,代碼來源:login.ts

示例10:

 loading.onDidDismiss(() => {
   let toast = this.toastCtrl.create({
     message: 'No faces detected, please try again',
     duration: 2000
   });
   toast.present();
 });
開發者ID:jgw96,項目名稱:ionic-mood,代碼行數:7,代碼來源:home.ts


注:本文中的ionic-angular.ToastController.create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。