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