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


TypeScript AlertController.create方法代碼示例

本文整理匯總了TypeScript中@ionic/angular.AlertController.create方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript AlertController.create方法的具體用法?TypeScript AlertController.create怎麽用?TypeScript AlertController.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@ionic/angular.AlertController的用法示例。


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

示例1:

   .catch( async error => {      
     
     this.salvaLog('auth',error,true);
     const alert = await this.alertCtrl.create({
       message: 'Houve um erro na sua solicitação.'+error,
       buttons: [{ text: 'Ok', role: 'cancel' }],
     });
     await alert.present();   
     console.error("SMS não enviado", error);
     
 
   });
開發者ID:aynoei,項目名稱:promon,代碼行數:12,代碼來源:auth.service.ts

示例2: chooseExport

  async chooseExport() {
    const alert = await this.alertController.create({
      header: "Export",
      message: "Choose your format for export !",
      inputs: [
        {
          name: 'JSONRadio',
          type: 'radio',
          label: 'JSON',
          value: 'json',
          checked: true
        },
        {
          name: 'CSVRadio',
          type: 'radio',
          label: 'CSV',
          value: 'csv'
        }
      ],
      buttons: [
        {
          text: 'Cancel',
          role: 'cancel',
          cssClass: 'secondary',
          handler: () => { }
        }, {
          text: 'Ok',
          handler: (data: string) => {
            if (data == 'json') {
              this.download.exportJSON();
            }
            else {
              this.download.exportCSV();
            }
          }
        }
      ]
    });

    await alert.present();
  }
開發者ID:PierrePlessy,項目名稱:pple_ultimateMovie,代碼行數:41,代碼來源:favorites.page.ts

示例3: clickMe

 async clickMe() {
   const alert = await this.alertController.create({
     title: 'ohhhh snap',
     message: 'Ive been injected via Angular keeping the old api',
     buttons: [
       {
         text: 'Cancel',
         role: 'Cancel',
         handler: () => {
           // console.log('cancel');
         }
       },
       {
         text: 'Okay',
         role: 'Okay',
         handler: () => {
           // console.log('okay');
         }
       }
     ]
   });
   return alert.present();
 }
開發者ID:keithdmoore,項目名稱:ionic,代碼行數:23,代碼來源:alert-page.component.ts

示例4: changeUsername

 // Present an alert with the current username populated
 // clicking OK will update the username and display it
 // clicking Cancel will close the alert and do nothing
 async changeUsername() {
   const alert = await this.alertCtrl.create({
     header: 'Change Username',
     buttons: [
       'Cancel',
       {
         text: 'Ok',
         handler: (data: any) => {
           this.userData.setUsername(data.username);
           this.getUsername();
         }
       }
     ],
     inputs: [
       {
         type: 'text',
         name: 'username',
         value: this.username,
         placeholder: 'username'
       }
     ]
   });
   await alert.present();
 }
開發者ID:andrelotto,項目名稱:ionic-conference-app,代碼行數:27,代碼來源:account.ts


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