本文整理汇总了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);
}
}
示例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);
}
示例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();
}
}