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