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


TypeScript ionic-angular.Alert类代码示例

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


在下文中一共展示了Alert类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: deleteGroup

  deleteGroup(event, group) {
    let confirm = Alert.create({
      title: 'Você deseja deletar o grupo?',
      message: 'Ao concordar todo o histórico do grupo será deletado',
      buttons: [
        {
          text: 'Não',
          handler: () => {
            console.log('Disagree clicked');
          }
        },
        {
          text: 'Sim',
          handler: () => {
            this.groupProvider.delete(group).then(() => {
              this.groups.splice(this.groups.indexOf(group), 1);
            }, (error) => {
              console.log(error);
            });
          }
        }
      ]
    });

    this.navCtrl.present(confirm);
  }
开发者ID:victorlcampos,项目名称:dividaBem,代码行数:26,代码来源:home.ts

示例2: signInWithOnyx

 private signInWithOnyx(form:{emailControl:string, passwordControl:string}):void {
     if (Meteor.isCordova) {
         var self = this;
         console.log("form: ", form);
         Session.set("email", form.emailControl);
         Meteor.call('isEmailRegistered', form.emailControl.toLowerCase(), function (error, result) {
             if (error) {
                 new ToastMessenger().toast({
                     type: "error",
                     title: "Sign In Error",
                     message: error.message
                 });
             } else if (!result) {
                 console.log("User not found");
                 Session.set("registeredError", true);
                 self.emailControl.updateValueAndValidity(true);
             } else {
                 new OnyxHelper(self.nav, self.translate).execOnyx({action: Onyx.Action.TEMPLATE});
                 Session.set("signInWithOnyx", form.emailControl.toLowerCase());
             }
         });
     } else {
         console.log("This feature is only available on cordova devices.");
         let alert = Alert.create({
             title: "Cordova Only!",
             message: "This feature is only available on cordova devices.",
             buttons: ["OK"]
         });
         this.nav.present(alert);
     }
 }
开发者ID:DFTinc,项目名称:ionic2-meteor-onyx,代码行数:31,代码来源:login-card.ts

示例3: removeItemFromCart

 removeItemFromCart(item){
     //this.cartService.removeItemById(item.id);
     
     let self = this;
     
     let alert = Alert.create({
         title: 'Confirm Delete',
         message: 'Are you sure you want to remove food item from cart?',
         buttons: [
         {
             text: 'Cancel',
             role: 'cancel',
             handler: () => {
                 console.log('Cancel clicked');
             }
         },
         {
             text: 'Remove',
             handler: () => {
                 console.log('Buy clicked');                    
                 self.cartService.removeItemById(item.id);
             }
         }
         ]
     });
     this.nav.present(alert);
     
 }
开发者ID:Anhmike,项目名称:Ionic2-ResturantApp,代码行数:28,代码来源:cart.ts

示例4: createTodo

  createTodo(){

    let prompt = Alert.create({
      title: 'Add',
      message: 'What do you need to do?',
      inputs: [
        {
          name: 'title'
        }
      ],
      buttons: [
        {
          text: 'Cancel'
        },
        {
          text: 'Save',
          handler: data => {
            this.todoService.createTodo({title: data.title});
          }
        }
      ]
    });

    this.nav.present(prompt);

  }
开发者ID:nstokoe,项目名称:dream-app-server,代码行数:26,代码来源:home.ts

示例5:

 }).then(() => {
   let prompt = Alert.create({
     message: "Save Data",
     buttons: [{ text: "Ok" }]
   });
   this.nav.present(prompt);
 });
开发者ID:junaidahmed93,项目名称:Ionic2-With-Firebase3-Authentication,代码行数:7,代码来源:auth-data.ts

示例6: renameItem

  renameItem(item): void{


    let prompt = Alert.create({
      title: 'Rename Item',
      message: 'Enter the new name of your new task below:',
      inputs: [
        {
          name: 'name'
        }
      ],
      buttons: [
        {
          text: 'Cancel'
        },
        {
          text: 'Save',
          handler: data => {

            this.checklist.renameItem(item);
          }
        }
      ]
    });

    this.nav.present(prompt);
  }
开发者ID:Arthurisme,项目名称:Ionic2Expert,代码行数:27,代码来源:checklist.ts

示例7: alert

 alert(msg) {
   let prompt = Alert.create({
     message: msg,
     buttons: [{text: "Ok"}]
   });
   this.nav.present(prompt);
 }
开发者ID:bkitaec,项目名称:mytest-app,代码行数:7,代码来源:notification.ts

示例8: function

NavController.prototype.alert = function (message: string): void {
    let alert = Alert.create({
        message: message,
        buttons: ['OK']
    });
    this.present(alert);
}
开发者ID:siavashgeeks,项目名称:msharp,代码行数:7,代码来源:NavController.ts

示例9:

 }, (status, response) => {
     if (response.error || !response.id) {
         let popup = Alert.create({
             title: 'Payment Error',
             subTitle: 'Please try again',
             buttons: ['Dismiss']
         });
         this.loading = false;
         this.nav.present(popup);
     } else {
       let request = { id: this.meetup.id, token : response.id}
       this.http.makeBackendRequest('POST', 'meetup/payement', request,
       response => {
           HttpService.showAlert(this.nav, "Its all good !", "Your presence has been confirmed ! Thanks you", {
               text: 'Ok',
               handler: () => {
                   this.nav.popToRoot();
               }
           });
       }, errorMessage => {
         // BECAUSE WHY NOT
         if (Object.keys(errorMessage).length == 0) {
           HttpService.showAlert(this.nav, "Its all good !", "Your presence has been confirmed ! Thanks you", {
               text: 'Ok',
               handler: () => {
                   this.nav.popToRoot();
               }
           });
         }
         else {
           HttpService.showAlert(this.nav, "Error code : " + errorMessage.status, "We got an internal problem, please retry.", "Ok");
         }
       }, true);
     }
 });
开发者ID:vmarchaud,项目名称:share_eat_mobile,代码行数:35,代码来源:checkout.ts

示例10: clicked

 clicked() {
   let prompt = Alert.create({
     title: 'New Item',
     message: "Enter the name of the item",
     inputs: [
       {
         name: 'title',
         placeholder: 'Title'
       },
     ],
     buttons: [
       {
         text: 'Cancel',
         handler: data => {
           console.log('Cancel clicked');
         }
       },
       {
         text: 'Save',
         handler: data => {
           ShoppingLists.insert({name:data.title,listId:this.par,completed:false});
         }
       }
     ]
   });
    this.nav.present(prompt);
  }
开发者ID:ShaharLahav,项目名称:Betting-game-admin,代码行数:27,代码来源:page3.ts


注:本文中的ionic-angular.Alert类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。