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


TypeScript ionic-angular.Toast類代碼示例

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


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

示例1: bgToggle

    /* Toggle for enabling and disabling background mode */
    bgToggle() {
	/* If already enabled, disable, notify user */
        if (cordova.plugins.backgroundMode.isEnabled()) {
            cordova.plugins.backgroundMode.disable();
	    this.bgText = "Enable Background Mode";
	    this.storage.storeBackgroundMode(null);
            let toast = Toast.create({
                message: "Background Mode Disabled",
                duration: 2000,
                position: 'bottom',
                showCloseButton: true
            });
            this.nav.present(toast);
        }
        /* Otherwise already disabled, so enable, notify user */
        else {
            cordova.plugins.backgroundMode.enable();
	    this.bgText = "Disable Background Mode";
	    /* Note that since storage works with strings, this could
	       be any string. More intuitive this way */
	    this.storage.storeBackgroundMode(true);
            let toast = Toast.create({
                message: "Background Mode Enabled",
                duration: 2000,
                position: 'bottom',
                showCloseButton: true
            });
            this.nav.present(toast);
        }
	
    }
開發者ID:mdash-ursi2016,項目名稱:ionic_code_typescript,代碼行數:32,代碼來源:bluetooth.ts

示例2:

 },error => {
   let toast = Toast.create({
     message: "登錄失敗!",
     duration: 2000
   })
   this.nav.present(toast)
 })
開發者ID:zhangxianmeng,項目名稱:ionicDemo,代碼行數:7,代碼來源:login.ts

示例3: validateUser

  validateUser() {
    var user = {
      email: this.email,
      password: this.password
    }
    if (!this.email || !this.password) {
      let toast = Toast.create({
        message: 'Please enter valid details',
        duration: 3000
      });
      this.nav.present(toast);
      return false;
    }

    let loading = Loading.create({
      content: 'Please wait...'
    });

    this.nav.present(loading);
    var self = this;
    this.backend.loginUser(user).then(function () {
      loading.dismiss();
    }).catch(function (e) {
      console.log("error invalid user", e);
    })
  }
開發者ID:sindhuh,項目名稱:coyotendancev2,代碼行數:26,代碼來源:login.ts

示例4: showLoginFailure

 showLoginFailure(message: string) {
     let toast = Toast.create({
         message: message,
         duration: 3000
     });
     this.nav.present(toast);
 }
開發者ID:isman-usoh,項目名稱:followork,代碼行數:7,代碼來源:login.ts

示例5: mostrarErro

 mostrarErro(erro: any, navCtrl: NavController) {
     let toast = Toast.create({
     message: erro,
     duration: 3000
     });
     navCtrl.present(toast);
 }
開發者ID:paulkjoseph,項目名稱:ionic-angular-firebase-partiu-app,代碼行數:7,代碼來源:global-method.service.ts

示例6: showToast

  showToast(msg: string): void { 
   let toast = Toast.create({
     message: msg,
     duration: 3000
   });
   this.nav.present(toast);
 }
開發者ID:android-sos,項目名稱:Ionic2Pokedex,代碼行數:7,代碼來源:login.ts

示例7: oops

 oops(navC:NavController) {
     navC.present(Toast.create(
         {
             message: 'oops! something went wrong.',
             duration: 1500
         }))
 }
開發者ID:pascalwhoop,項目名稱:esn-couchsurfing,代碼行數:7,代碼來源:user-feedback-helpers.ts

示例8: validateUser

 validateUser() {
   var user = {
     email: this.email,
     password: this.password
   }
   if (!this.email || !this.password) {
     let toast = Toast.create({
       message: 'Please enter valid details',
       duration: 3000
     });
     this.nav.present(toast);
     return false;
   }
   let loading = Loading.create({
     content: 'Please wait...'
   });
   this.nav.present(loading);
   var self = this;
   this.backend.loginUser(user).then(function () {
     localStorage.setItem('email', user.email);
     setTimeout(() => {
       loading.dismiss();
     });
     if (self.backend.userDetails.isProfessor) {
       self.nav.push(TabsPage);
     } else {
       self.nav.push(StudentTabsPage);
     }
   }).catch(function() {
     console.log("error invalid user");
   })
 }
開發者ID:sindhuh,項目名稱:Coyotendance,代碼行數:32,代碼來源:login.ts

示例9:

 }, error => {
   l.dismiss();
   let t = Toast.create({
     message: 'Sin conexion!',
     duration: 2000
   })
 });
開發者ID:sclMAX,項目名稱:IndumaticsApp,代碼行數:7,代碼來源:catalogo-perfiles.ts

示例10: create

  create(message, ok = false, duration = 2000) {
    if (this.toast) {
      this.toast.dismiss();
    }

    this.toast = this.toastCtrl.create({
      message,
      duration: ok ? null : duration,
      position: 'bottom',
      showCloseButton: ok,
      closeButtonText: 'OK'
    });
    this.toast.present();
  }
開發者ID:jctovar,項目名稱:iztacala,代碼行數:14,代碼來源:toast-service.ts


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