当前位置: 首页>>代码示例>>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;未经允许,请勿转载。