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


TypeScript ionic-angular.ToastController類代碼示例

本文整理匯總了TypeScript中ionic-angular.ToastController的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToastController類的具體用法?TypeScript ToastController怎麽用?TypeScript ToastController使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ToastController類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: presentToast

  private presentToast(success: boolean, response: any): void {
    const message: string = success
      ? 'Transaction successfully broadcast. Trasaction id: ' + response.txid
      : 'An error occurred: ' + response;
    if (this.toast) {
      this.toast.dismiss();
    }

    this.toast = this.toastCtrl.create({
      message,
      position: 'bottom',
      showCloseButton: true,
      dismissOnPageChange: true
    });
    this.toast.present();
  }
開發者ID:bitpay,項目名稱:bitcore,代碼行數:16,代碼來源:broadcast-tx.ts

示例2: identify

  identify(phone){
    // this.item['note'] = phone;//把手機號碼傳回去
    // console.log(this.item)
    console.log(phone);
    let toast = this.toastCtrl.create({
      message: '修改成功',
      duration: 1500,
      position: 'middle'
    });
    toast.present();
    toast.onDidDismiss(() => {
      console.log('Dismissed toast');
      this.viewCtrl.dismiss(phone);
    });

  }
開發者ID:lany9527,項目名稱:NEWS,代碼行數:16,代碼來源:modify-phone.ts

示例3: presentToast

  presentToast() {
    let toast = this.toastCtrl.create({
      message: 'Thank You, You Will Be Notified!',
      duration: 3000,
      position: 'bottom',
      showCloseButton: true,
      closeButtonText: 'Ok',
      dismissOnPageChange: true
    });

    toast.onDidDismiss(()=>{
      console.log('Dismissed Toast');
    });
    toast.present();

  }
開發者ID:maazkabir,項目名稱:trackomed,代碼行數:16,代碼來源:care.ts

示例4:

 this.sw.updates.subscribe(res => {
   if (res.type === 'pending') {
     let toast = this.toastCtrl.create({
       message: 'A new version is available, reload ',
       closeButtonText: "Reload",
       showCloseButton: true,
     });
     toast.onDidDismiss((data, role) => {
       if (role === 'close') {
         this.sw.activateUpdate(res.version)
           .subscribe(value => value && location.reload());
       };
     });
     toast.present();
   }
 });
開發者ID:pinkasey,項目名稱:activegan,代碼行數:16,代碼來源:service-worker.ts

示例5: if

 this.events.subscribe('wordpress:savestatus', (state) => {
   console.log(state);
   if (state.state === 'saving') {
     this.loader.present();
     console.log('saving');
   }
   else if (state.state === 'error') {
     this.loader.dismiss();
     this.createLoader();
     this.toastCtrl.create({ message: 'Error Saving Report', duration: 3000 }).present();
   }
   else if (state.state === 'finished') {
     this.loader.dismiss();
     this.createLoader();
     console.log('finished');
   }
 });
開發者ID:qwb0920,項目名稱:wp-rest-api-ionic2,代碼行數:17,代碼來源:report.ts

示例6: handleError

  handleError(error: any) {
    let message: string;
    if (error.status && error.status === 401) {
      message = 'Login failed';
    }
    else {
      message = `Unexpected error: ${error.statusText}`;
    }

    const toast = this.toastCtrl.create({
      message,
      duration: 5000,
      position: 'bottom'
    });

    toast.present();
  }
開發者ID:Darkmarus,項目名稱:blog,代碼行數:17,代碼來源:login.ts

示例7:

        data => {
          loading.dismissAll();

          if (data === undefined && data.fileasbase64 == undefined) {
            let toast = this.toastController.create({
                            message: 'Unable to get file content',
                            duration: 3000,
                            position: 'middle'
                          });
            toast.present();
          }
          else {
             
             this.openDocument(item.name, data.mimeType, data.fileAsBase64);
             //open(cordova.file.applicationDirectory + item.url, '_blank', 'location=no,enableViewPortScale=yes');
          }
      },
開發者ID:letuthanhson,項目名稱:ionic,代碼行數:17,代碼來源:counterparty-ca.ts

示例8: toastShowWithOptions

    toastShowWithOptions(options: ToastOptions) {
        if (this.isMobile()) {
            this.toast.showWithOptions(options).subscribe(
                toast => {
                }
            );
        } else {
            let toast = this.toastCtrl.create({
                message: options.message,
                duration: options.duration,
                position: options.position
            });

            toast.present();
        }

    }
開發者ID:qwb0920,項目名稱:LlgApp,代碼行數:17,代碼來源:NativeService.ts

示例9:

   data => {
     loading.dismissAll();
     this.caFileList = data;
     if (this.caFileList === undefined || this.caFileList.length === 0) {
       let toast = this.toastController.create({
                       message: 'Credit Review documents are not available for the counterparty',
                       duration: 3000,
                       position: 'middle'
                     });
       toast.present();
     }
     else {
       //this.showCaActionSheet();  //For this version there is only Action Items.  Let's go directly
       //open the list of documents for the cp
       this.navCtrl.push(CounterpartyCaPage,
           { "counterpartyName": this.cpInfo.name, "documents": this.caFileList });
     }
 },
開發者ID:letuthanhson,項目名稱:ionic,代碼行數:18,代碼來源:counterparty-info.ts

示例10:

    this.http.get(api.url + '/users/forLikes/'+user_id+'/0', api.setHeaders(true)).subscribe(data => {
    loading.dismiss();
    this.users = data.json().users.items;
    this.texts = data.json().texts;


            // If there's message, than user can't be on this page
            if (data.json().arenaStatus) {
                let toast = this.toastCtrl.create({
                    message: data.json().arenaStatus,
                    showCloseButton: true,
                    closeButtonText: 'אישור'
                });

                toast.present();
                this.navCtrl.push(ChangePhotosPage);
            }
    });
開發者ID:interdate,項目名稱:SheDate-iOS,代碼行數:18,代碼來源:arena.ts


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