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


TypeScript ionic-angular.AlertController类代码示例

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


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

示例1: if

 this.sub = this.store.let(getAddPaymentProviderStatus).subscribe((status: ApiRequestStatus) => {
   if (status.success && !status.loading) {
     // Provider added, navigate to its page
     this.viewCtrl.dismiss(provider);
   } else if (!status.loading && !status.success && status.error) {
     // an error occurred, show dialog
     this.alertCtrl.create({
       title: this.translate.instant('could_not_authorize'),
       message: this.errorService.getErrorMessage(status.error),
       buttons: [ this.translate.instant('ok') ]
     }).present();
   }
 });
开发者ID:our-city-app,项目名称:mobicage-payment,代码行数:13,代码来源:add-payment-provider-description-page.component.ts

示例2:

 handler401() {
     let alert = this.alertCtrl.create({
         title: 'Erro 401: Falha de autenticação',
         message: 'Email ou senha incorretos',
         enableBackdropDismiss: false,
         buttons: [
             {
                 text: 'ok'
             }
         ]
     });
     alert.present();
 }
开发者ID:fhtozetto,项目名称:curso-spring-ionic-frontend,代码行数:13,代码来源:error-interceptor.ts

示例3: handlerDefaultError

 handlerDefaultError(errorObj) {
     let alert = this.alertCtrl.create({
         title: 'Erro ' + errorObj.status + ': ' + errorObj.error,
         message: errorObj.message,
         enableBackdropDismiss: false,
         buttons: [
             {
                 text: 'ok'
             }
         ]
     });
     alert.present();
 }
开发者ID:fhtozetto,项目名称:curso-spring-ionic-frontend,代码行数:13,代码来源:error-interceptor.ts

示例4:

		    this.loading.dismiss().then( () => {
			var errorMessage: string = error.message;
			let alert = this.alertCtrl.create({
			    message: errorMessage,
			    buttons: [
				{
				    text: "Ok",
				    role: 'cancel'
				}
			    ]
			});
			alert.present();
		    });
开发者ID:rajesh241,项目名称:libtech,代码行数:13,代码来源:signup.ts

示例5: handleResponse

  handleResponse(response){
  	let alert = null;
  	if(!!response["enterprise"]){
			this.enterprise = response["enterprise"];
			if(this.mode == "create")
      	this.enterprises.push(this.enterprise);
			alert = this.alert.create({
				title: "Success!",
				subTitle: `New enterprise ${this.mode}d!`,
				buttons: ["Ok"]
			});
		} else {
      if(!!response["errors"])
        this.errors = response["errors"];
      
			alert = this.alert.create({
				title: response["statusText"],
				subTitle: `Couldn't ${this.mode} the enterprise at the moment.`,
				buttons: ["Dismiss"]
			});
		}
		alert.present();
  }
开发者ID:baobba,项目名称:userms-ui,代码行数:23,代码来源:enterprise-form.ts

示例6: logOut

 logOut() {
     this.alertCtrl.create({
         title: '确认退出登陆?',
         buttons: [
             { text: '取消' },
             {
                 text: '确定',
                 handler: () => {
                     this.events.publish('user:logout', 'logout');
                 }
             }
         ]
     }).present();
 }
开发者ID:qwb0920,项目名称:LlgApp,代码行数:14,代码来源:mine.ts

示例7:

 this.local.get(OPTIONS_KEY_NAME).then((res) => {
   let options = JSON.parse(res) || {};
   if (options.ignoreDuplicateScans && isDuplicate) {
     let alert = this.alerts.create({
       title: 'Duplicate Entry',
       subTitle: 'This scan has been ignored.',
       buttons: ['Dismiss']
     });
     alert.present();
   }
   else {
     this.fetchItem(barcodeData);
   }
 });
开发者ID:dstreicher,项目名称:bmnh-specimen-label-scanner,代码行数:14,代码来源:tabs.ts

示例8:

      }).toPromise().then((res: any) => {
        if (res.result == true) {
          let alert = this.alertCtrl.create({
            title: '',
            subTitle: 'success',
            buttons: ['OK'],
          });
          alert.present().then(()=>{
            this.navCtrl.pop();
          }); 
        }else {
          let alert = this.alertCtrl.create({
            title: 'sorry',
            subTitle: res.des,
            buttons: ['OK'],
          });
          alert.present().then(()=>{
         
          });

        }

      }).catch(() => {
开发者ID:classOnline,项目名称:classOnline,代码行数:23,代码来源:NodeCommentPage.ts

示例9: presentAlert

  presentAlert(title: string, message: string) {
    const alert = this.alertCtrl.create(
      {
        title,
        subTitle: message,
        buttons: [
          {
            text: 'OK'
          }
        ]
      });

    return alert.present();
  }
开发者ID:jctovar,项目名称:iztacala,代码行数:14,代码来源:alert-service.ts

示例10: confirm

 confirm(title: string, message: string, handler: (value: any) => boolean | void) {
   const alert = this.alertCtrl.create({
     title: title,
     message: message,
     buttons: [{
       text: '取消',
       role: 'cancel'
     }, {
       text: '确定',
       handler: handler
     }]
   });
   alert.present();
 }
开发者ID:qwb0920,项目名称:ext-ionic,代码行数:14,代码来源:dialog.ts

示例11: authenticate

  /**
   * Authentication handler
   */
  authenticate() {
    let confirm = this.alertCtrl.create({
      title: 'Unauthenticated',
      message: "Looks like you need new keys. You'll have to log in again!",
      buttons: [{
        text: 'Login',
        handler: () => {
          this.redirect();
        }
      }]
    });

    confirm.present();
  }
开发者ID:maxtuzz,项目名称:ldapa-oauth,代码行数:17,代码来源:app.ts

示例12: forgotPassword

 forgotPassword() {
   const prompt = this.alertCtrl.create({
     title:  this.translateService.instant('RESET_PASSWORD.LINK'),
     subTitle:  this.translateService.instant('RESET_PASSWORD.SUBTITLE'),
     inputs: [
       {
         name: 'email',
         placeholder: this.translateService.instant('RESET_PASSWORD.PLACEHOLDER')
       },
     ],
     buttons: [
       {
         text: this.translateService.instant('Cancel'),
         handler: data => {
           console.log('Cancel clicked');
         }
       },
       {
         text: this.translateService.instant('RESET_PASSWORD.SUBMIT'),
         handler: data => {
           this.loading = this.loadingCtrl.create({
             dismissOnPageChange: true,
           });
           if (this.isValid(data.email)) {
             this.loading.present();
             this.authService.forgotPassword(data.email)
             .then(
               () => {
                 this.loading.dismiss().then(() => {
                   this.meuToastService.present(this.translateService.instant('RESET_PASSWORD.SUCCESS'));
                 });
               }
             )
             .catch(
               err => {
                 this.loading.dismiss().then(() => {
                   this.meuToastService.present(this.translateService.instant('RESET_PASSWORD.ERROR'));
                 });
               }
             );
           } else {
             this.meuToastService.present(this.translateService.instant('Invalid Email'));
             return false;
           }
         }
       }
     ]
   });
   prompt.present();
 }
开发者ID:meumobi,项目名称:infomobi,代码行数:50,代码来源:login.ts

示例13: about

 // Method to check about
 public about(val){
     const alert = this.alertCtrl.create({
         title: 'About Antibiotic Policy',
         message: `
             <div> Version v0.0.1 </div><br>
             <div> Developed by </div><br>
             <span><strong> Raster Images Pvt Ltd </strong></span>
         `,
         buttons: ['Close']
       });
     alert.present();
     this.selectedTitle = val.target.textContent;
     this.viewCtrl.dismiss(this.selectedTitle);
 }
开发者ID:jogaian282,项目名称:projectFiles,代码行数:15,代码来源:settings.ts

示例14: showErrorMessage

 showErrorMessage(){
   let confirm = this.alert.create({
     title: 'Probleem met camera',
     message: 'Camera kan niet geopend worden.',
     buttons: [
       {
         text: 'OK',
         handler: () => {
           console.log('Disagree clicked');
         }
       }
     ]
   });
 confirm.present();
 }
开发者ID:50Hannah000,项目名称:MDB1,代码行数:15,代码来源:camera.ts

示例15: clearSyncInfo

 clearSyncInfo() {
   let confirm = this.alertController.create({
     title: "Forget Dropbox credentials",
     message: "Do you really want to clear the Dropbox authentication data?",
     buttons: [{
       text: "Yes",
       handler: () => {
         this.settings.removeDropboxAuthInfo();
       }
     }, {
       text: "No"
     }]
   });
   confirm.present();
 }
开发者ID:janwillemb,项目名称:Ema-Personal-Wiki,代码行数:15,代码来源:settings.ts


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