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