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


TypeScript Events.publish方法代码示例

本文整理汇总了TypeScript中ionic-angular.Events.publish方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Events.publish方法的具体用法?TypeScript Events.publish怎么用?TypeScript Events.publish使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ionic-angular.Events的用法示例。


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

示例1: handlePayPro

  private handlePayPro(payProDetails, url, coin?: Coin): void {
    if (!payProDetails) {
      this.logger.error('No wallets available');
      const error = this.translate.instant('No wallets available');
      this.events.publish('incomingDataError', error);
      return;
    }

    const stateParams = {
      amount: payProDetails.amount,
      toAddress: payProDetails.toAddress,
      description: payProDetails.memo,
      paypro: payProDetails,
      coin,
      payProUrl: url,
      requiredFeeRate: payProDetails.requiredFeeRate
        ? Math.ceil(payProDetails.requiredFeeRate * 1024)
        : undefined
    };
    const nextView = {
      name: 'ConfirmPage',
      params: stateParams
    };
    this.events.publish('IncomingDataRedir', nextView);
  }
开发者ID:bitpay,项目名称:copay,代码行数:25,代码来源:incoming-data.ts

示例2:

 this.auth.onAuthStateChanged((user: any) => {
   if (user) {
     this.events.publish('user:login');
   } else {
     events.publish('user:logout');
   }
 });
开发者ID:balynsky,项目名称:ionic2-neighbors,代码行数:7,代码来源:firebase.service.ts

示例3: goSend

 private goSend(
   addr: string,
   amount: string,
   message: string,
   coin: Coin
 ): void {
   if (amount) {
     let stateParams = {
       amount,
       toAddress: addr,
       description: message,
       coin
     };
     let nextView = {
       name: 'ConfirmPage',
       params: stateParams
     };
     this.events.publish('IncomingDataRedir', nextView);
   } else {
     let stateParams = {
       toAddress: addr,
       description: message,
       coin
     };
     let nextView = {
       name: 'AmountPage',
       params: stateParams
     };
     this.events.publish('IncomingDataRedir', nextView);
   }
 }
开发者ID:hcxiong,项目名称:copay,代码行数:31,代码来源:incoming-data.ts

示例4: Uint16Array

	this.liveStepSubscription.subscribe(buffer => {
	    let data = new Uint16Array(buffer);
	    this.events.publish('steps',data[0]);

	    /* For total steps, calculate how many steps to add as the current
	       step count minues the previous */
	    this.totalSteps += (data[0] - this.lastStepCount);
	    this.lastStepCount = data[0];
	    this.events.publish('totalsteps',this.totalSteps);

	    
	});
开发者ID:mdash-ursi2016,项目名称:ionic_code_typescript,代码行数:12,代码来源:blservice.ts

示例5: selectCity

  selectCity(index, area) {
    if (typeof index === 'number') {
      if (!area) {
        this.province = this.locales[index].name;
        this.citys = this.locales[index].city;
        if (this.citys.length === 1) {
          this.area = this.citys[0].area;
        }
      } else {
        this.city = this.citys[index].name;
        this.area = this.citys[index].area;
      }
      this.nav.push(LocaleSelectPage, { province: this.province, city: this.city, citys: this.citys, area: this.area });
    } else if (typeof index === 'string') {
      let locale = {
        province: this.province,
        city: this.city || this.province,
        district: index,
        str: this.province
      };

      let backIndex = 0;
      if (this.city) {
        backIndex = this.view.index - 3;
      } else {
        backIndex = this.view.index - 2;
      }
      locale.str = locale.city + ' ' + locale.district;
      this.nav.popTo(this.nav.getByIndex(backIndex));
      this.events.publish('select:locale', locale);
    }
  }
开发者ID:zjcboy,项目名称:ionic2-select-city,代码行数:32,代码来源:ionic2-select-city.ts

示例6: backdropDismiss

 public backdropDismiss(): void {
   this.events.publish('selectWalletEvent');
   this.showSlideEffect = false;
   setTimeout(() => {
     this.showWalletsSelector = false;
   }, 150);
 }
开发者ID:bitjson,项目名称:copay,代码行数:7,代码来源:wallet-selector.ts

示例7: selectWallet

 public selectWallet(wallet: any): void {
   this.events.publish('selectWalletEvent', wallet);
   this.showSlideEffect = false;
   setTimeout(() => {
     this.showWalletsSelector = false;
   }, 150);
 }
开发者ID:bitjson,项目名称:copay,代码行数:7,代码来源:wallet-selector.ts

示例8: saveForm

  async saveForm(){
    console.log('SAVE GOT CALLED')
    await this.recipes.save(this.recipe.value)
    this.events.publish('refresh-recipes')
    this.nav.pop()

  }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例9: logEvent

  logEvent(event) {
    if ( this.description && this.value ) {
      let saved = this.events.publish('saveItem', this.description, this.value );
      if (saved) {
        var toast = this.toastCtrl.create({
          message: 'Datos guardados',
          duration: 3000
        });
        this.description = "";
        this.value = "";
      } else {
        var toast = this.toastCtrl.create({
          message: 'Ocurrio un problema al guardar',
          duration: 3000
        });
      }
      toast.present();
    } else {
      let alert = this.alertCtrl.create({
        subTitle: 'La descripciรณn y el valor son obligatorios',
        buttons: ['OK']
      });
      alert.present();
    }

  }
开发者ID:LuisEstebanArango,项目名称:cuentas-app,代码行数:26,代码来源:home.ts

示例10: onRemoveClick

 public onRemoveClick() {
     const index = this.listsService.lists.indexOf(this.list);
     this.listsService.lists.splice(index, 1);
     this.events.publish('lists:added');
     this.listsService.sync();
     this.viewController.dismiss(true);
 }
开发者ID:adasq,项目名称:mb-ui,代码行数:7,代码来源:settings.ts


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