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