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


TypeScript Alert.create方法代碼示例

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


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

示例1: confirmarPedido

    confirmarPedido(){
        if(!this.ps.user){
            this.nav.present(Alert.create({title:"Advertencia", message:"Debe iniciar sesión para realizar pedidos", buttons: ["ok"]}))
            return;
        }
        if(!(this.ps.selectedAddress != undefined  && this.ps.addresses[this.ps.selectedAddress])){
            this.nav.present(Alert.create({title:"Advertencia", message:"Debe elegir una dirección para realizar pedidos", buttons: ["ok"]}))
            return;
        }
        let ConfirmarAlert = Alert.create({
            message:"¿Esta Seguro de que desea procesar el Carrito?",
            title:'Confirmar',
            buttons:
            [
                {
                    text: 'Aun No',
                    handler: () => {
                        console.log('Disagree clicked');
                    }
                },
                {
                    text: 'Confirmar',
                    handler: () => {
                        this.procesarCarrito();
                    }
                }
            ]
        });

        this.nav.present(ConfirmarAlert);
    }
開發者ID:seedgabo,項目名稱:Prestashop-Mobile,代碼行數:31,代碼來源:carrito.ts

示例2: showMessage

  showMessage(message: string, type: number){
    /*
			1 = status
			2 = success
			3 = error
		*/

    if (type == 1) {
      let alert = Alert.create({
        title: '',
        subTitle: message,
        buttons: ['OK']
      });
      this.nav.present(alert);
    } else if (type == 2) {
      let alert = Alert.create({
        title: 'Success!',
        subTitle: message,
        buttons: ['OK']
      });
      this.nav.present(alert);
    } else if (type == 3) {
      let alert = Alert.create({
        title: 'Error!',
        subTitle: message,
        buttons: ['OK']
      });
      this.nav.present(alert);
    }
    return;
  }
開發者ID:JDonadio,項目名稱:recovery-tool-ionic2,代碼行數:31,代碼來源:recovery-tool.ts

示例3: fireRestPassword

 fireRestPassword() {
     if (this.newPassword !== this.newPassword1) {
         let alert = Alert.create({
             title: '兩次輸入的新密碼不一致!',
             buttons: ['OK']
         });
         this.nav.present(alert);
     } else if (this.password !== '1' || this.newPassword !== '1' || this.newPassword1 !== '1') {
         let alert = Alert.create({
             title: '密碼不正確!',
             buttons: ['OK']
         });
         this.nav.present(alert);
     } else {
         let alert = Alert.create({
             title: '密碼修改成功!',
             buttons: [{
                 text: 'OK', handler: data => {
                     setTimeout(()=> this.nav.pop(), 500);
                 }
             }]
         });
         this.nav.present(alert);
     }
 }
開發者ID:flmfly,項目名稱:rapp,代碼行數:25,代碼來源:reset-password.ts

示例4: renameItem

    renameItem(item): void {

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

        this.nav.present(prompt);

    }
開發者ID:Adriano72,項目名稱:quicklists,代碼行數:26,代碼來源:checklist.ts

示例5: addNewChapter

 addNewChapter(){
   let prompt = Alert.create({
     title: 'New Chapter',
     message: "Enter name of chapter",
     inputs: [
       {
         name: 'chapter',
         placeholder: 'Chaoter'
       }
     ],
     buttons: [
       {
         text: 'Cancel',
         handler: data => {
           console.log('Cancel clicked');
         }
       },
       {
         text: 'Save',
         handler: data => {
           console.log(data.chapter);
           //call db
           console.log('Added');
         }
       }
     ]
   });
   this.nav.present(prompt);
 }
開發者ID:RashmiNalwad,項目名稱:T2E_StudentView,代碼行數:29,代碼來源:class-home.ts

示例6: clearAllPodcasts

    public clearAllPodcasts() {
        let alertClearAll = Alert.create({
            title:   "Supprimer tous les podcasts ?",
            message: 'Ceci est utilisé à des fins de développement ou si votre application est bloquée',
            buttons: [
                {
                    text:    "Non",
                    handler: () => {
                        alertClearAll.dismiss();
                    }
                },
                {
                    text:    "Oui",
                    handler: () => {
                        let loading = Loading.create({
                            content: 'Suppression en cours...'
                        });

                        this.navController.present(loading);
                        this.podcastService.clearAll().then(() => {
                            this.podcastService.updatePodcasts().then(() => {
                                loading.dismiss();
                            });
                        });

                    }
                }
            ]
        });


        this.navController.present(alertClearAll);
    }
開發者ID:HugoHeneault,項目名稱:LaBas,代碼行數:33,代碼來源:settings.ts

示例7: login

    login(username:string,password:string,rememberMe:boolean):Observable<any> {
        if(username.toLowerCase() !== 'admin' || password.toLowerCase() !== 'admin') {
            let alert = Alert.create({
                title: 'Invalid credentials',
                subTitle: 'You entered invalid credentials !',
                buttons: ['Ok']
            });
            return Observable.throw(alert);
        } else {

            let headers = new Headers();
            headers.append(CONTENT_TYPE_HEADER, APPLICATION_JSON);

            return this.http.post(BACKEND_URL,JSON.stringify({login:username,password:password}),{headers:headers}).map((res:Response) => {

                let loginData:any = res.json();
                let user:User = this.readJwt(loginData.token);
                user.username = username;
                user.password = password;

                console.log('Login successful', user);

                if (rememberMe) {
                    console.log('Remember me: Store user and jwt to local storage');
                    StorageUtils.setAccount(user);
                    StorageUtils.setToken(loginData.token);
                }

                return user;
            });
        }
    }
開發者ID:RedFroggy,項目名稱:ionic2-nfc-app,代碼行數:32,代碼來源:login.service.ts

示例8: follow

 follow(){
     let alert = Alert.create({
         title: '請輸入跟投份數',
         inputs: [
             {
                 label: '跟投份數',
                 name: 'follow_num',
                 placeholder: '請輸入跟投份數',
                 type: 'number',
                 value: '1'
             }
         ],
         buttons: [
             {
                 text: '取消',
                 role: 'cancel',
                 handler: data => {
                     console.log('Cancel clicked');
                 }
             },
             {
                 text: '確認',
                 handler: data => {
                     console.log(data.follow_num);
                     this.nav.push(SuccessPage, {
                         item: data.follow_num
                     });
                 }
             }
         ]
     });
     this.nav.present(alert);
 }
開發者ID:bigsuperangel,項目名稱:ionic_pro,代碼行數:33,代碼來源:view.ts

示例9: askForPassword

 askForPassword(onOkClick: OnConfirmPassCallback, onCancelClick?: OnCancelCallback) {
   let prompt = Alert.create({
     title: 'Login',
     message: "Please, enter the password to proceed with the operation",
     inputs: [
       {
         name: 'pass',
         type: "password",
         placeholder: 'Password'
       },
     ],
     buttons: [
       {
         text: 'Ok',
         handler: data => {
           if (onOkClick != undefined) {
             onOkClick(String(data.pass));
           }
         }
       },
       {
         text: 'Cancel',
         handler: data => {
           if (onCancelClick != undefined) {
             onCancelClick();
           }
         }
       }
     ]
   });
   this.nav.present(prompt);
 }
開發者ID:EricFG82,項目名稱:AutoHome-Frontend,代碼行數:32,代碼來源:page3.ts

示例10: updateTodo

  updateTodo(todo){

    let prompt = Alert.create({
      title: 'Edit',
      message: 'Change your mind?',
      inputs: [
        {
          name: 'title'
        }
      ],
      buttons: [
        {
          text: 'Cancel'
        },
        {
          text: 'Save',
          handler: data => {
            this.todoService.updateTodo({
                _id: todo._id,
                _rev: todo._rev,
                title: data.title
            });
          }
        }
      ]
    });

    this.nav.present(prompt);
  }
開發者ID:nstokoe,項目名稱:dream-app-server,代碼行數:29,代碼來源:home.ts


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