当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript angular.AlertController类代码示例

本文整理汇总了TypeScript中@ionic/angular.AlertController的典型用法代码示例。如果您正苦于以下问题:TypeScript AlertController类的具体用法?TypeScript AlertController怎么用?TypeScript AlertController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AlertController类的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类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。