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


TypeScript NavController.getActive方法代碼示例

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


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

示例1: constructor

 constructor(
   private nav: NavController,
   private locationProvider: LocationProvider
 ) {
   const activeNav = this.nav.getActive()
   this.locationProvider.getCurrentCity()
     .then(city => {
       if (city === null && !activeNav) {
         this.gotoSettings()
       }
     })
     .catch((err) => {
       console.log(err)
     })
 }
開發者ID:StreetSupport,項目名稱:streetsupport-app,代碼行數:15,代碼來源:header.ts

示例2: onBackButton

 private onBackButton() {
     try {
         if (this.menu.isOpen()) {
             this.menu.close();
         } else {
             var activePage = this.navController.getActive();
             if (activePage.instance.onBackButton) {
                 activePage.instance.onBackButton();
             } else {
                 this.navController.pop();
             }
         }
     } catch (err) {
         this.loggingService.log("Error onBackButton", err);
     }
 }
開發者ID:janwillemb,項目名稱:Ema-Personal-Wiki,代碼行數:16,代碼來源:app.component.ts

示例3: handleKeyboardEvent

  @HostListener('document:keydown', ['$event']) handleKeyboardEvent(event: KeyboardEvent) {
    if (this.navCtrl.getActive().name != 'AmountPage') return;
    if (!event.key) return;
    if (event.which === 8) {
      event.preventDefault();
      this.removeDigit();
    }

    if (event.key.match(this.reNr)) {
      this.pushDigit(event.key);
    } else if (event.key.match(this.reOp)) {
      this.pushOperator(event.key);
    } else if (event.keyCode === 86) {
      if (event.ctrlKey || event.metaKey) this.processClipboard();
    } else if (event.keyCode === 13) this.finish();
  }
開發者ID:bitjson,項目名稱:copay,代碼行數:16,代碼來源:amount.ts

示例4: openPage

 openPage(pageID) {
   switch(pageID) {
     case 0: {
       if (this.navCtrl.getActive().component != HomePage) {
         this.navCtrl.setRoot(HomePage, {fromSideMenu: true});
       }
       break;
     }
     case 1: {
       this.navCtrl.push(InfoPage);
       break;
     }
     case 2: {
       this.navCtrl.push(ImpressumPage);
       break;
     }
   }
 }
開發者ID:University-of-Potsdam-MM,項目名稱:ReflectUP,代碼行數:18,代碼來源:tab-bar.ts

示例5:

 navTransition.then(() => {
   let elementRef:ElementRef = this.navController.getActive().contentRef();
   this.cacheService.cacheImages($(elementRef.nativeElement).find('img'));
 });
開發者ID:michaeldesigaud,項目名稱:palmashow-app,代碼行數:4,代碼來源:groups.ts

示例6: removePageFromHistory

 protected removePageFromHistory() {
   const startIndex = this.navCtrl.getActive().index - 1;
   this.navCtrl.remove(startIndex, 1);
 }
開發者ID:bitpay,項目名稱:copay,代碼行數:4,代碼來源:purchased-cards.ts

示例7: shouldDisplaySettingsLink

 get shouldDisplaySettingsLink() {
   const activeNav = this.nav.getActive()
   if (activeNav) {
     return activeNav.component.name !== 'SettingsPage'
   }
 }
開發者ID:StreetSupport,項目名稱:streetsupport-app,代碼行數:6,代碼來源:header.ts

示例8: redir

  public redir(data: string): boolean {
    // TODO Injecting NavController in constructor of service fails with no provider error
    this.navCtrl = this.app.getActiveNav();

    // data extensions for Payment Protocol with non-backwards-compatible request
    if ((/^bitcoin(cash)?:\?r=[\w+]/).exec(data)) {
      let coin = 'btc';
      if (data.indexOf('bitcoincash') === 0) coin = 'bch';

      data = decodeURIComponent(data.replace(/bitcoin(cash)?:\?r=/, ''));

      this.payproProvider.getPayProDetails(data, coin).then((details) => {
        this.handlePayPro(details, coin);
      }).catch((err) => {
        this.popupProvider.ionicAlert(this.translate.instant('Error'), err);
      });

      return true;
    }

    data = this.sanitizeUri(data);
    let amount: string;
    let message: string;
    let addr: string;
    let parsed: any;
    let coin: string;

    // Bitcoin  URL
    if (this.bwcProvider.getBitcore().URI.isValid(data)) {
      this.logger.debug('Handling Bitcoin URI');
      coin = 'btc';
      parsed = this.bwcProvider.getBitcore().URI(data);
      addr = parsed.address ? parsed.address.toString() : '';
      message = parsed.message;
      amount = parsed.amount ? parsed.amount : '';

      if (parsed.r) {
        this.payproProvider.getPayProDetails(parsed.r, coin).then((details) => {
          this.handlePayPro(details, coin);
        }).catch((err: string) => {
          if (addr && amount) this.goSend(addr, amount, message, coin);
          else this.popupProvider.ionicAlert(this.translate.instant('Error'), err);
        });
      } else {
        this.goSend(addr, amount, message, coin);
      }
      return true;
      // Cash URI
    } else if (this.bwcProvider.getBitcoreCash().URI.isValid(data)) {
      this.logger.debug('Handling Bitcoin Cash URI');
      coin = 'bch';
      parsed = this.bwcProvider.getBitcoreCash().URI(data);
      addr = parsed.address ? parsed.address.toString() : '';

      // keep address in original format
      if (parsed.address && data.indexOf(addr) < 0) {
        addr = parsed.address.toCashAddress();
      };

      message = parsed.message;
      amount = parsed.amount ? parsed.amount : '';

      // paypro not yet supported on cash
      if (parsed.r) {
        this.payproProvider.getPayProDetails(parsed.r, coin).then((details: any) => {
          this.handlePayPro(details, coin);
        }).catch((err: string) => {
          if (addr && amount)
            this.goSend(addr, amount, message, coin);
          else
            this.popupProvider.ionicAlert(this.translate.instant('Error'), err);
        });
      } else {
        this.goSend(addr, amount, message, coin);
      }
      return true;

      // Cash URI with bitcoin core address version number?
    } else if (this.bwcProvider.getBitcore().URI.isValid(data.replace(/^bitcoincash:/, 'bitcoin:'))) {
      this.logger.debug('Handling bitcoincash URI with legacy address');
      coin = 'bch';
      parsed = this.bwcProvider.getBitcore().URI(data.replace(/^bitcoincash:/, 'bitcoin:'));

      let oldAddr = parsed.address ? parsed.address.toString() : '';
      if (!oldAddr) return false;

      addr = '';

      let a = this.bwcProvider.getBitcore().Address(oldAddr).toObject();
      addr = this.bwcProvider.getBitcoreCash().Address.fromObject(a).toString();

      // Translate address
      this.logger.debug('address transalated to:' + addr);
      let title = this.translate.instant('Bitcoin cash Payment');
      let msg = this.translate.instant('Payment address was translated to new Bitcoin Cash address format: {{addr}}', { addr });
      this.popupProvider.ionicConfirm(title, msg).then((res: boolean) => {
        if (!res) return false;

        message = parsed.message;
        amount = parsed.amount ? parsed.amount : '';
//.........這裏部分代碼省略.........
開發者ID:bitjson,項目名稱:copay,代碼行數:101,代碼來源:incoming-data.ts


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