當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。