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


TypeScript NavController.popTo方法代码示例

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


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

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

示例2: submitForm

  submitForm(){
    console.log(this.jobofferForm.value.desc);
    const newJobOffer = new Joboffer(
      this.jobofferForm.value.desc,
      this.datePipe.transform(this.jobofferForm.value.bd, 'yyyy-MM-dd'),
      this.datePipe.transform(this.jobofferForm.value.ed, 'yyyy-MM-dd'),
      this.jobofferForm.value.contactNumber,
      this.jobofferForm.value.fow,
      this.jobofferForm.value.salaryE,
      this.jobofferForm.value.companyN,
      this.jobofferForm.value.companyA,
      this.jobofferForm.value.contactE,
      this.jobofferForm.value.contactN,
      this.jobofferForm.value.title);


      this.jobofferService.addJobOffer(newJobOffer).subscribe(
        (jobOfferAdded:Joboffer)=>{

        }
      );
    this.jobofferService.jobOfferAdded.emit(newJobOffer);
    this.navCtrl.popTo(JobOffersPage);
    //this.viewCtrl.dismiss(false);


  }
开发者ID:midanirachdi,项目名称:RC-Ionic3,代码行数:27,代码来源:job-offer-add.ts

示例3: activate

  async activate(userDetails: { username?: string; activationCode: string }) {
    const loading = await this.loadingCtrl.show({ content: 'Activating' });
    try {
      const didLogIn = await this.createAccountProvider.activate(userDetails);
      this.toastCtrl.show({
        message: 'Account created',
        duration: 4000,
      });

      if (didLogIn) {
        this.dismissModal();
      } else {
        this.navCtrl.popTo('LoginPage');
      }
    } catch (err) {
      console.warn(err);

      this.form.group.setErrors({
        invalidRequest: true,
      });

      if (err.message === 'No username') {
        this.createForm(true);
        return;
      }
    } finally {
      loading.dismiss();
    }
  }
开发者ID:ifiske,项目名称:iFiske,代码行数:29,代码来源:create-account-verify.ts


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