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


TypeScript ionic-angular.Events類代碼示例

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


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

示例1: listenToGpsEvents

  listenToGpsEvents() {
    this.events.subscribe('gps:on', () => {
      this.gpstracking = true;
    });

    this.events.subscribe('gps:off', () => {
      this.gpstracking = false;
    });
  }
開發者ID:maxamillion32,項目名稱:fleetany-mobile,代碼行數:9,代碼來源:login.ts

示例2: listenToLoginEvents

 listenToLoginEvents() {
   //fired when the user logs in
   this.events.subscribe('user:login', () => {
     this.loadStations();
   });
   this.events.subscribe('user:logout', () => {
     if (this.stations) {
       this.stations = null;
     }
   });
 }
開發者ID:RickyTaterSalad,項目名稱:FireIonic2,代碼行數:11,代碼來源:station-data.ts

示例3: listenToLoginEvents

 listenToLoginEvents() {
     this.events.subscribe('user:login', (str) => {
         this.rootPage = 'TabsPage';
         this.initJpush();
     });
     this.events.subscribe('user:logout', (str) => {
         this.nativeService.removeStorage('token');
         this.loginModal = this.modalCtrl.create('LoginPage');
         this.loginModal.present();
         this.rootPage = 'TabsPage';
     });
 }
開發者ID:qwb0920,項目名稱:LlgApp,代碼行數:12,代碼來源:app.component.ts

示例4:

 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

示例5: 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

示例6: subscribeToNameListChanges

 private subscribeToNameListChanges() {
   this.events.subscribe("admin:name:added", (data: Array<{uid: string, name: string, username: string}>) => {
     let isSortingNeeded = false;
     data.forEach((user) => {
       if(user.uid !== this.firebaseService.getMyUid()) {
         console.log("Adding:"+JSON.stringify(user));
         this.nameList.push(user);
         this.zone.run(() => this.nameClassifier.addToUserList(user));
         isSortingNeeded = true;
       }
     });
     if(isSortingNeeded) {
       this.sortNameList();
     }
   });
   
   this.events.subscribe("admin:name:changed", (data: Array<{uid: string, name: string, username: string}>) => {
     let isSortingNeeded = false;
     data.forEach((user) => {
       let changedUser = this.nameList.find((iter)=> iter.uid === user.uid);
       if(changedUser != null) {
         changedUser.name = user.name;
         changedUser.username = user.username;
         console.log("updating user list");
         this.zone.run(() => this.nameClassifier.updateUser(user));
         isSortingNeeded = true;
       }
     });
     if(isSortingNeeded) {
       this.sortNameList();
     }
   });
 }
開發者ID:isvicbhasme,項目名稱:greeter,代碼行數:33,代碼來源:admin.ts

示例7: 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

示例8: openPINModal

 private openPINModal(action): void {
   this.isModalOpen = true;
   this.events.publish('showPinModalEvent', action);
   this.events.subscribe('finishPinModalEvent', () => {
     this.isModalOpen = false;
     this.events.unsubscribe('finishPinModalEvent');
   });
 }
開發者ID:bitjson,項目名稱:copay,代碼行數:8,代碼來源:app.component.ts

示例9: openFingerprintModal

 private openFingerprintModal(): void {
   this.isModalOpen = true;
   let isCopay = this.appProvider.info.nameCase == 'Copay' ? true : false;
   this.events.publish('showFingerprintModalEvent', isCopay);
   this.events.subscribe('finishFingerprintModalEvent', () => {
     this.isModalOpen = false;
     this.events.unsubscribe('finishFingerprintModalEvent');
   });
 }
開發者ID:bitjson,項目名稱:copay,代碼行數:9,代碼來源:app.component.ts

示例10:

	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


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